Mutlitpe PrefetchPath2

Posts   
 
    
Kris Nobels avatar
Posts: 118
Joined: 02-Apr-2008
# Posted on: 10-Dec-2010 09:00:28   

Hello,

I got this strange behavior.

I need to get a list of contacts.

Every contact has an adres, and every adres has a country entity.

contact --> Adres --> Country --> Language

Now this is my PrefetchPath2 but i get an error.

                var path = new PrefetchPath2((int)EntityType.ContactenEntity)
                               {
                                   ContactenEntity.PrefetchPathTalen,
                                   ContactenEntity.PrefetchPathAdressen.SubPath.Add(AdressenEntity.PrefetchPathLanden)
                               };

The prefetch path element at index 1 in the passed in prefetch path for root entity type 4 is meant for root entity type 0 which isn't a subtype of 4. This means that you've added a prefetch path node to a Path of an unrelated entity, for example adding OrderDetailsEntity.PrefetchPathProduct to a prefetch path for CustomerEntity.

And there relations exist where they need to be.

Can someone tell me what is wrong ?

is this the correct way to do it ?

Kris

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 10-Dec-2010 12:30:28   

Does any of the envolved entities fall into an inheritance hierarchy?

(btw) This is not the right forum for issues and bugs. Next time please use either "Generated Code" or Bugs & issues".

Kris Nobels avatar
Posts: 118
Joined: 02-Apr-2008
# Posted on: 10-Dec-2010 17:19:04   

Sorry for the wrong location.

You may delete this thread.

And no there is no inheritance.

I create just my tables in the mysql database.

After that i created the relations between tables.

Generate code with llblgen

and create the DAL layer to retrieve and store data.

that's it.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 10-Dec-2010 22:40:31   

Kris wrote:

You may delete this thread.

And no there is no inheritance.

I create just my tables in the mysql database.

After that i created the relations between tables.

Generate code with llblgen

and create the DAL layer to retrieve and store data.

that's it.

Should we assume you resolved the problem?

David Elizondo | LLBLGen Support Team
Kris Nobels avatar
Posts: 118
Joined: 02-Apr-2008
# Posted on: 03-Jan-2011 13:07:17   

You may delete this thread.

I deleted the generated files and generate it again.

problem solved.