I am not able to get the dependent entities for perticular entity

Posts   
 
    
Posts: 13
Joined: 10-Feb-2006
# Posted on: 05-May-2006 13:44:56   

I have using LLBL gen generated code for my project that contains Adapter with Webservice architechture so my question is related to denpendent entities for perticular entity.

In My project I have

OrderEntity and it relates to Artikel,Klanten Entity now my question is when i am loading OrderEntity I need to get the which entities are related to Order Entity something like this

I try to achive this using GetDependentRelatedEntities and GetDependingRelatedEntities but always i am getting emplty collection.

Please let me know what is the problem with this and how can i achive this using LLBL gen.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-May-2006 14:11:39   

If you want to get related entities filled with data when you fetch an entity. You should be using PrefetchPaths.

Please refer to "Using the generated code -> Adapter -> Prefetch paths" in the LLBLGen Pro manual.

Posts: 13
Joined: 10-Feb-2006
# Posted on: 08-May-2006 09:12:59   

i tried with the prefetchpath but i am not getting exactl dependent entities i have many entities dependent in order but that is providing me only one entity.

DataAccessAdapter adapter = new DataAccessAdapter(true); OrdersEntity orderEntity = new OrdersEntity(70737); PrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.OrdersEntity); prefetchPath.Add(OrdersEntity.PrefetchPathArtikelen); prefetchPath.Add(OrdersEntity.PrefetchPathKosten); prefetchPath.Add(OrdersEntity.PrefetchPathSubofferte);

    adapter.FetchEntity(orderEntity,prefetchPath);
    IEntityCollection2 Hirarchy= new EntityCollection();
    Hirarchy = orderEntity.GetDependentRelatedEntities();

Now i have Artikelen,Kosten and Subofferte but the collection giving me only one entity. so please tell me if i am missing something.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 08-May-2006 16:07:52   

if both GetDependentRelatedEntities() and GetDependingRelatedEntities() do not return the expected results. You may examine the generated SQL queries and run them against the database to see if related entities already exist for this entity or not.