cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <do...@xsinet.co.za>
Subject Re: Inheritance Question
Date Fri, 20 Dec 2013 06:50:09 GMT
Thanks for your reply Andrus.

I don't suppose that there is a way to tell Cayenne not to be so eager in 
this case ?

Jurgen


-----Original Message----- 
From: Andrus Adamchik
Sent: Friday, December 20, 2013 8:27 AM
To: user@cayenne.apache.org
Subject: Re: Inheritance Question

>From what I can tell, this is the intended behavior. If your SelectQuery 
root is ClassOne, Cayenne expects that the result might contain a mix of 
ClassOne and any of its subclasses (which means ClassTwo as well). So the 
columns in SELECT are a superset of columns for all the classes involved.

Andrus


On Dec 12, 2013, at 12:30 PM, dollj@xsinet.co.za wrote:
> Hi All
>
> I have a dbEntity say ClassOne (its lightweight) and another that inherits 
> from it as ClassTwo (its heavyweight).
>
> Now in my case I have a prefetch that retrieves ClassOne objects.
>
> The problem that I have is that Cayenne is fetching ClassTwo data as well 
> ?!
>
> Surely Cayenne should only be fetching the ClassOne data, why is ClassTwo 
> data also being retrieved ?
>
> Is this the intended behaviour ?   Is there a way to prevent it ?
>
> Thanks, Jurgen
>
>
>


Mime
View raw message