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 
>> [email protected] 
>> 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.

Reply via email to