Any alternative for prefetch path? (using adapter model)

Posts   
 
    
horo
User
Posts: 41
Joined: 01-Sep-2005
# Posted on: 20-Jan-2008 17:48:44   

Hi to All,

What is the correct way to load collection properties of an entity defined by an 1-n and n-m relation?

(I would like to fill customer.Orders) with orders.

I know the prefetch path. Is there any alternative? (on demand?)

(I also know the adapter.FetchEntityCollection(orders, customer.GetRelationInfoOrders()); shortcut)

thx for answers

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 20-Jan-2008 20:16:28   

these are the methods to fill a collection using the adapter model. what do you mean by 'on demand?' like SS? if so then the answer is no.

SS is quick and convenient. the objects can access the database from anywhere in code. The adapter model is designed to be a gateway to the db. the developer must know what information they require before calling the db.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Jan-2008 09:42:25   

As Jason has said, in the Adapter model, you either has to fetch the related entities beforehand (using prefetchPaths), or manually fetch them when you need them. But no LazyLoading (won't automatically be fetched when accessed).

horo
User
Posts: 41
Joined: 01-Sep-2005
# Posted on: 23-Jan-2008 10:30:06   

Hi,

Thx for answers.

horo