entity relationship question

Posts   
 
    
nologo
User
Posts: 1
Joined: 23-Nov-2010
# Posted on: 23-Nov-2010 14:12:24   

hi, new to LLBLgen & ORM's so apologise for what i assume is an easy solution. my entities look something like this:

class TABLE1
public int ID get/set
public string EntityName get/set
public List<JoinTableEntity> get/set
class JoinTableEntity:
public int ID get/set
public int Table1_FK get/set
public int Table2_FK get/set
public  Table2 Table2 get/set

Class Table2
public int ID get/set
public string Name get/set

now my domainQuery:

new DomainQuery<Table1>
{
 Query = ID,
 PrefetchItems = { new Prefetch(typeof(JoinTableEntity)) }
};

the problem is, the Table2 is not being populated for my jointableEntity. because i want to return the value from my

JoinTableEntity.Table2.Name

so i want to add a prefetch to the prefetch?how do i correctly go about this?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 23-Nov-2010 21:09:07   

Which framework are you targetting...?

Matt

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 24-Nov-2010 09:52:14   

prefetchPath.Add(CustomerEntity.PrefetchPathOrders).SubPath.Add(OrderEntity.PrefetchPathOrderDetails);

See Prefetch paths basics

Frans Bouma | Lead developer LLBLGen Pro