I know where the problem is. I am using InheritanceType.SINGLE_TABLE and it seems that OpenJPA does not store any class identificatior in table. Information about class is reconstructed from NULL and NON NULL fields. So if subclass declares some fields which are null, OpenJPA does not have any informations which can lead to original class and simply use class declareted in Query.
Collumn for this info should be created automaticly as is specified in JPA. http://java.sun.com/javaee/5/docs/api/javax/persistence/DiscriminatorColumn.html But OpenJPA does not create it automatically. There is entire chapter about that in manual. Solution: @DiscriminatorColumn on root class of hierarchy. Regards, Jan -- View this message in context: http://www.nabble.com/Subclasses-instances-and-query-tf4249297.html#a12143287 Sent from the OpenJPA Users mailing list archive at Nabble.com.
