openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From janek <>
Subject Subclasses instances and query
Date Fri, 10 Aug 2007 15:10:56 GMT

I have problem with query and returned result.

I have three classes: 
  superclass Car, 
  Audi and Hyundai  which extends Car

After persisting some instances of Audi and H., 
query "SELECT c FROM Car c" returns the some 
number of Car instances.

The problem is that result is only of type Car,
I can not cast it up to Audi or Hyunday. 

I understand that this is more efficient, 
but I need full instances, not just superclass. 
Is there any switch which will turn "full subclass fetch" on?

Thanks in advance,
Jan Kotek

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message