Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Self referencing Many to Many (m:n)
 

Pages: 1
LLBLGen Pro Runtime Framework
Self referencing Many to Many (m:n)
Page:1/1 

  Print all messages in this thread  
Poster Message
ConfluentData
User



Location:

Joined on:
21-Oct-2004 20:43:02
Posted:
37 posts
# Posted on: 02-Dec-2004 19:27:46.  
I apologize if someone else has asked this before, but a quick search didn't yield an answer.

How can I achieve a self referencing many to many relationship with LLBLGen?

This is what I mean:

EntityTable
-----------------
EntityID (PK)
EntityName
EtcField

JunctionTable
-----------------
JunctionID (PK)
PrimaryEntityID (FK for EntityID)
SecondaryEntityID (FK for EntityID)

So Entity can have 0 or more "children" as well as 0 or more "parents" (each accessible through a field in the Entity BL). Is that clear enough? Is it possible with LLBLGen?
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38086 posts
# Posted on: 03-Dec-2004 10:01:25.  
These relations are not generated because these are resolvable from the 1.n or m:1 relations automatically. For example, you can retrieve the parents of an entity using an entity collection and a filter: say your entitytable is Customer and your junctiontable is Junction. You create a customercollection to hold the parents, and you construct a filter on junction.primaryentityid + you specify the relation customer-junction in the relationcollection. Then call getmulti.

If you run into problems constructing this, please let me know.

(note: the relation finder throws out m:n relations to self for the reason that these result in a filter on the same table. I'll check if your particular situation can be added to the designer's relation finder)


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
ConfluentData
User



Location:

Joined on:
21-Oct-2004 20:43:02
Posted:
37 posts
# Posted on: 06-Dec-2004 01:00:20.  
Thanks, I'll take a look at that.
  Top
Marcus
User



Location:
Dublin, Ireland
Joined on:
23-Apr-2004 11:49:41
Posted:
747 posts
# Posted on: 21-Dec-2004 01:22:02.  
Otis wrote:
(note: the relation finder throws out m:n relations to self for the reason that these result in a filter on the same table. I'll check if your particular situation can be added to the designer's relation finder)

Frans,

I've hit this same problem with a adjacency list table... I would also like to be able to keep fields based on a m:n relation with self.

I understand you can get the collection easy enough but, not having the usual properties "ChildEntities" / "ParentEntities" on the Entity itself is a bit disappointing... Sad

Is this a big deal to put back in?


Blog: http://www.styledesign.biz/weblogs/macinnesm/
Website http://pix.ie
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38086 posts
# Posted on: 21-Dec-2004 10:17:37.  
Well, it's a bit of a pain to generate them, as they aren't the usual m:n relations, so they require a special case in the templates and likely a new TDL statement.
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Marcus
User



Location:
Dublin, Ireland
Joined on:
23-Apr-2004 11:49:41
Posted:
747 posts
# Posted on: 21-Dec-2004 11:08:20.  
Otis wrote:
Well, it's a bit of a pain to generate them, as they aren't the usual m:n relations, so they require a special case in the templates and likely a new TDL statement.

Sad - I get the message!


Blog: http://www.styledesign.biz/weblogs/macinnesm/
Website http://pix.ie
 
Top
Marcus
User



Location:
Dublin, Ireland
Joined on:
23-Apr-2004 11:49:41
Posted:
747 posts
# Posted on: 15-Mar-2005 14:31:17.  
Frans,

Is this issue addressed in the new Beta 2004.2?

Marcus
Blog: http://www.styledesign.biz/weblogs/macinnesm/
Website http://pix.ie
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38086 posts
# Posted on: 15-Mar-2005 15:10:33.  
Marcus wrote:
Frans,

Is this issue addressed in the new Beta 2004.2?

Marcus

No, I'm sorry, this hasn't been addressed. Which is my fault, I never put it on the todo list. Though it will result in perhaps even more m:n relations which are already a plague for some projects.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Mountain
User



Location:
Florida
Joined on:
01-Apr-2005 05:05:51
Posted:
21 posts
# Posted on: 01-Apr-2005 19:44:35.  
Otis wrote:
Then call getmulti.


I'm using adapter and EntityCollectionBase2. I don't see a GetMulti. Does this not apply to adapter? Thanks.
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38086 posts
# Posted on: 01-Apr-2005 22:08:20.  
Mountain wrote:
Otis wrote:
Then call getmulti.


I'm using adapter and EntityCollectionBase2. I don't see a GetMulti. Does this not apply to adapter? Thanks.

Yes, you there have to call FetchEntityCollection.


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.