Prefetch Without Polymorphism

Posts   
 
    
BaileyK83
User
Posts: 29
Joined: 30-Dec-2006
# Posted on: 18-Nov-2008 02:17:54   

Is there anyway to make a prefetch path non polymorphic

our db uses a lot of inheritance and I just want the base entityclass without left joining every entity in the database.

Please tell me this is possible

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 18-Nov-2008 07:54:28   

Hi there. Could you give an example (code snippet or approximate SQL) of what you are trying to do?

David Elizondo | LLBLGen Support Team
BaileyK83
User
Posts: 29
Joined: 30-Dec-2006
# Posted on: 18-Nov-2008 20:28:33   

Object ID OwnerID->Related To Object.ID

Cat: Object

Dog: Object

Deer: Object

Person: Object

let's say I want to get all objects that have the ownerid of the person but I dont want to left join every single object to do it. I just want the object entity. I don't want it to be polymorphic

Dim lCollection as new EntityCollection(Of PersonEntity) Dim lPath as new PrefetchPath2(EntityType.PersonEntity) lPath.add(PersonEntity.PrefetchPathOwnedBy) adapter.FetchEntityCollection(lCollection, PrefetchPath2)

or even

Dim lCollection as NEw EntityCollection(of objectentity) Dim lBucket as new relationpredicatebucket lBucket.PredicateExpression.Add(ObjectFields.OwnerMainId = 72) adapter.FetchEntityCollection(lCollection, lBucket)

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Nov-2008 08:12:48   

Sorry, I think that is not possible.

What you can do is add the involved entity twice (at LLBLGen Pro Designer). For example the inherited entity is _BoardMember _and the other entity is MyUnInheritedBoardMember. The second doesn't participate in inheritance, thus you can use it normal with prefetchPaths. Please try that.

David Elizondo | LLBLGen Support Team