EntityCollection and non Polymorphic fetches

Posts   
 
    
koushikks
User
Posts: 9
Joined: 23-May-2007
# Posted on: 23-May-2007 21:31:25   

This is my table structure and I have set up TargetPerEntity for all the classes.

Event |---AudioEvent |---VideoEvent |---VideoPlayedEvent |---RecordEvent |---RecordPlayedEvent etc


DataAccessAdapter adapter = new DataAccessAdapter();
EntityCollection events = new EntityCollection(new EventEntityFactory());
adapter.FetchEntityCollection(events, null);

The fetch is polymorphic and I get the right derived objects in my result. Which is good in most cases.

Is there any way to fetch only the items of my root object and not my derived objects when using the Entity collection? I want to avoid the overhead associted with fetching the derived table data.

Thanks, KK

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 24-May-2007 09:16:20   
  • Use a DynamicList to fetch only the data in the Events table.
  • You may project the resultSet into an EntityCollection.