Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> many to many with additional fields in association table
 

Pages: 1
LLBLGen Pro Runtime Framework
many to many with additional fields in association table
Page:1/1 

  Print all messages in this thread  
Poster Message
scotru
User



Location:
College Place, WA
Joined on:
16-Feb-2006 01:03:42
Posted:
104 posts
# Posted on: 09-Jun-2016 20:06:15.  
I'm looking for advice on how best to handle the situation described here:

http://stackoverflow.com/questions/7050404/create-code-first-many-to-many-with-additional-fields-in-association-table

Say, I have a many-to-many relation from A to C thru association table B (which also has additional fields). Ideally, I'd like to map both B and C (joined) to one entity with and many to one relation to A (and vice-versa, ie. to have another entity mapped to A and B with a many to one relation to C).

Is this possible with LLBLGen? If not, could I get best practices or suggestions for handing this type of scenario?
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37879 posts
# Posted on: 10-Jun-2016 11:41:12.  
scotru wrote:
I'm looking for advice on how best to handle the situation described here:

http://stackoverflow.com/questions/7050404/create-code-first-many-to-many-with-additional-fields-in-association-table

Say, I have a many-to-many relation from A to C thru association table B (which also has additional fields). Ideally, I'd like to map both B and C (joined) to one entity with and many to one relation to A (and vice-versa, ie. to have another entity mapped to A and B with a many to one relation to C).

Is this possible with LLBLGen? If not, could I get best practices or suggestions for handing this type of scenario?

You can't map an entity to a joined set (so it's not possible to map an entity to the join of B and C). What you describe is supported though. It's called an 'Objectified Relationship' in relationship modeling and you simply have 3 entities: A, B and C. A and C have a m:n relationship, B has a m:1 relationship with A and a m:1 relationship with C. these 2 m:1 relationships are the basis for the m:n relationship between A and C. If you're familiar with the old Northwind database, what you describe is the Order - OrderDetails - Product entity set-> OrderDetails has a m:1 relationship with Order and a m:1 relationship with Product. This gives a m:n relationship between Order and Product over these 2 relationships.

Our runtime supports this setup as well.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.