in

CodeSmith Community

Your Code. Your Way. Faster!

Get By Foreign Key methods not being created for all tables.

Last post 11-30-2006 3:37 PM by mikew_Hounston. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-28-2006 5:55 PM

    • peterv
    • Not Ranked
    • Joined on 09-13-2006
    • Posts 3
    • Points 105

    Get By Foreign Key methods not being created for all tables.

    Hi All,

    I am just curious as to why .NET tiers will not generate my foreign key get methods for my service layer?

    I have three tables: table A table B and Table C.

    Table A is the primary key table for table B and table B is the primary key table for Table C

    only table C ever has it's get by foreignkey methods created.

    Is this because in tables A and B the foregin key is also part of an index?

    If so why does this stop the creation of these methods?  Is there a particular architecture, or any other, reason as to why this would be bad practice?

    Thanks in advance

    Pete

    Filed under:
    • Post Points: 65
  • 11-29-2006 1:40 PM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 723
    • Points 16,775

    Re: Get By Foreign Key methods not being created for all tables.

    peterv,

    I couldn't replicate the issue you describe. netTiers should generate the GetByFK method even if the column also indexed.

    peterv:

    Hi All,

    I am just curious as to why .NET tiers will not generate my foreign key get methods for my service layer?

    I have three tables: table A table B and Table C.

    Table A is the primary key table for table B and table B is the primary key table for Table C

    only table C ever has it's get by foreignkey methods created.

    Is this because in tables A and B the foregin key is also part of an index?

    If so why does this stop the creation of these methods?  Is there a particular architecture, or any other, reason as to why this would be bad practice?

    Thanks in advance

    Pete

    Mike Shatny
    -------------------------------------
    Member of the .netTiers team
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 5
  • 11-30-2006 3:37 PM In reply to

    Re: Get By Foreign Key methods not being created for all tables.

    I had lots of problems with this.

    Some I could fix some I could not.

     1. Make sure the tool you used to create the relationships did what you expected it to do.
         One tool I used to do my schema did not update the relationships.

     2. Some tools require that the relationship match an existing index.

     3. The tool does a good job, but it is not perfect, so check what is generated and see if it is doing what you want, it doesn't allways!!!

    Thanks

    Mike Wassermann
    • Post Points: 5
Page 1 of 1 (3 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems