openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From No1UNo <je...@jerrycarter.org>
Subject Re: Do native queries respect inheritance?
Date Sat, 13 Nov 2010 18:44:10 GMT

Pinaki:

The behavior is unchanged.  The returned class is still the child (B) but only the members
of the parent (A) are retrieved.  The SQL logging confirms that the table associated with
B is never accessed.

-=- Jerry

On Nov 13, 2010, at 1:16 PM, Jerry Carter wrote:

> I'll run the experiment in a few minutes, but that wouldn't be proper in general.  I
have more than one class which is derived from the parent and don't know which class will
be produced by the query a priori.
> 
> 
> On Nov 13, 2010, at 1:00 PM, Pinaki Poddar [via OpenJPA] wrote:
> 
>> > Query query = em.createNativeQuery("...", A.class); 
>> > My expectation is that this query should return an instance of B 
>> 
>> What happens if you do 
>>    Query query = em.createNativeQuery("...", B.class);
>> Pinaki
>> 
>> 
>> View message @ http://openjpa.208410.n2.nabble.com/Do-native-queries-respect-inheritance-tp5731353p5735853.html

>> To start a new topic under OpenJPA Users, email ml-node+208411-1703014788-244680@n2.nabble.com

>> To unsubscribe from OpenJPA Users, click here.
>> 
> 


-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Do-native-queries-respect-inheritance-tp5731353p5735925.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message