Prefetch spanning multiple relations

Posts   
 
    
Posts: 34
Joined: 20-Apr-2005
# Posted on: 20-Apr-2005 13:44:52   

Is it possible to set up a prefetch path for adapter that can span more than one relation(unless its m:n)?

Lets say I have 3 tables, contact , address and an area lookup (related m:1 and 1:n). I can set up a prefetch to retrieve address entities for each contact simply enough, but would like to avoid having to iterate over the addresses fetching the lookup tables. Being able to do this would be useful in lots of cicumstances - especialy for report datasets where I need to fetch a complete graph 'just in case'.

Ryan

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Apr-2005 14:18:54   

ryanroberts wrote:

Is it possible to set up a prefetch path for adapter that can span more than one relation(unless its m:n)?

Lets say I have 3 tables, contact , address and an area lookup (related m:1 and 1:n). I can set up a prefetch to retrieve address entities for each contact simply enough, but would like to avoid having to iterate over the addresses fetching the lookup tables. Being able to do this would be useful in lots of cicumstances - especialy for report datasets where I need to fetch a complete graph 'just in case'. Ryan

You can setup ANY graph using prefetch paths. simple_smile

I'll illustrate adapter here, selfservicing uses the variants with the '2' simple_smile

PrefetchPath2 path = new PrefetchPath2((int)EntityType.ContactEntity); path.Add(ContactEntity.PrefetchPathAddress).SubPath.Add(AddressEntity.PrefetchPathAreaLookup);

et voila simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Posts: 34
Joined: 20-Apr-2005
# Posted on: 20-Apr-2005 14:25:02   

Aha, SubPath! Should pay more attention to intellisense simple_smile

Marvelous stuff Frans. If I could take this oppertunity to request features for your next release - the ability to map child entity collections to their parent in the same manner as fields would be handy.

Ryan

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Apr-2005 14:45:17   

ryanroberts wrote:

Aha, SubPath! Should pay more attention to intellisense simple_smile

Marvelous stuff Frans. If I could take this oppertunity to request features for your next release - the ability to map child entity collections to their parent in the same manner as fields would be handy.

Ryan

Do you have an example for that?

Frans Bouma | Lead developer LLBLGen Pro
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 21-Apr-2005 18:56:56   

Otis wrote:

You can setup ANY graph using prefetch paths. simple_smile

I'll illustrate adapter here, selfservicing uses the variants with the '2' simple_smile

PrefetchPath2 path = new PrefetchPath2((int)EntityType.ContactEntity); path.Add(ContactEntity.PrefetchPathAddress).SubPath.Add(AddressEntity.PrefetchPathAreaLookup);

et voila simple_smile

This was exactly what I was looking for! I think I'm in love....with the software of course.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 22-Apr-2005 09:46:30   

NickD wrote:

Otis wrote:

You can setup ANY graph using prefetch paths. simple_smile

I'll illustrate adapter here, selfservicing uses the variants with the '2' simple_smile

PrefetchPath2 path = new PrefetchPath2((int)EntityType.ContactEntity); path.Add(ContactEntity.PrefetchPathAddress).SubPath.Add(AddressEntity.PrefetchPathAreaLookup);

et voila simple_smile

This was exactly what I was looking for! I think I'm in love....with the software of course.

Heh yeah it sometimes has that effect on people wink

Frans Bouma | Lead developer LLBLGen Pro