Hector_Lopez wrote:
Try specifying: polymorphism="explicit" in the <class> tags.
Bye.
Thanks a lot (credit assigned). This does help in my case.
I can imagine cases however where it doesn't help: in my case I have already an inheritance tree, the subclasses are mapped with <subclass> element which doesn't allow for polymorphism="explicit", so I had to disable implicit polymorphism for the whole class hierarchy.
In my case that does not matter.
Still, is it not strange that this assymetry exists? There seems to be no way in HQL to signify I want the entity X, not the class X. But when I use X2, the entity is taken automatically since no class X2 exists.
I wish there were a way in HQL to tell that I only want the entity X.