Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Architecture> Inheritance Advice for Relations
 

Pages: 1
Architecture
Inheritance Advice for Relations
Page:1/1 

  Print all messages in this thread  
Poster Message
JRR
User



Location:
Western Canada
Joined on:
07-Dec-2005 23:33:05
Posted:
125 posts
# Posted on: 26-Jan-2009 19:56:46.  
I have a base entity:
  • Spawn


I have subTypes:
  • OrderSpawn
  • BlockSpawn
  • UnkownSpawn


I have entities related to the subTypes:
  • Order
  • Block


Finally, I have another entity that needs to have a reference to a spawn (any type)
  • Crop


My question is:
How can I design this so each crop has 1 relation to a spawn (not 1 relation for each subtype = 3), and from that spawn, I can get the subtype, and then final entity related to that subtype (Order, block)?
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
7642 posts
# Posted on: 28-Jan-2009 07:33:28.  
Just add the Spawn->Crop relation to the base. Then construct the inheritance. You just did it once (with the parent), the subtypes will inherit that relation.

David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
JRR
User



Location:
Western Canada
Joined on:
07-Dec-2005 23:33:05
Posted:
125 posts
# Posted on: 28-Jan-2009 08:27:18.  
So when I do this:

Crop --> Spawn

I have a spawn entity. The question is: what is the subtype of that spawn entity? And how can I find that type in C#?
(using the determiner field method - TargetPerHeirarchy?)

Is there a clean way to do this in the LLBLGen entity framework?
  Top
JRR
User



Location:
Western Canada
Joined on:
07-Dec-2005 23:33:05
Posted:
125 posts
# Posted on: 29-Jan-2009 21:04:39.  
Wow - creating subtypes is really easy with relations. I see that the relation is mapped to the subtype as well.

The designer knew which sub types should have which relation, based upon which fields they inherited.

Impressive!


  Top
Pages: 1  


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

Version: 2.1.12172008 Final.