CodeSmith Community
Your Code. Your Way. Faster!

Many to Many... to Many?

Latest post 05-08-2008 11:05 AM by rhettc. 4 replies.
  • 03-18-2008 10:10 AM

    Many to Many... to Many?

    Could anyone point me at the template that decides what constitutes a relationship table?

    .netTiers works as expected if my relationship tables do not contain their own auto generated primary key. 

    However, we have the case where we are linking association tables to association tables, and thus using a surrogate guid pk in all tables, including our relationship tables. 

    This appears to make netTiers think our association tables are first class entity tables, and the indirect mappings are not being generated on the first class entity objects, just the properties to get all the corresponding association table rows.

    Thanks in advance!

     Derrick

     

     

     

    • Post Points: 35
  • 03-19-2008 8:23 AM In reply to

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

    Re: Many to Many... to Many?

    Reply |Contact |Answer
    Mike Shatny ------------------------------------- Member of the .netTiers team http://www.nettiers.com -------------------------------------
    • Post Points: 35
  • 03-20-2008 9:55 AM In reply to

    Re: Many to Many... to Many?

    Great, thanks! 

    • Post Points: 35
  • 05-07-2008 6:38 PM In reply to

    • rhettc
    • Top 200 Contributor
    • Joined on 05-02-2007
    • Posts 24
    • Points 504

    Re: Many to Many... to Many?

    Derrick, were you able to modify this to get the results you wanted? 

     I also have a database that uses surrogate keys in the join tables... Is it really as simple as getting the template to recogize these as many to many relationships?  Does anyone know if the generated code in the service base class would work properly with this modification?  Maybe I'm asking if there are any known issues with doing this, I realize I'd have to test whatever sort of modifications I made to the template Smile

    Filed under: ,
    • Post Points: 5
  • 05-08-2008 11:05 AM In reply to

    • rhettc
    • Top 200 Contributor
    • Joined on 05-02-2007
    • Posts 24
    • Points 504

    Re: Many to Many... to Many?

    I was able to modify the code in CommonSqlCode.cs so that it recognized my junction tables.  After that some many to many relationships were modeled without issue.  However the template started to crash before it could complete.  I think it had problems generating names for methods.  Anyhow, we have deicided to change our tables so that the FK columns are the PK and we'll just leave the identity column intact. 

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