Honestly, I've been frustrated by this at times... but when it comes down to it, I find that I'm doing something lame when I need to query concrete instances of a base class directly. When I need that, I tend to go ahead and create an abstract base class and two subclasses.
If A extends B, then asking for all the B's which aren't A's is essentially like doing instanceof in hql.
To answer the question you actually asked, I believe polymorphism="explicit" does actually work, but then you won't be able to query for all of the B's and A's in one shot... I definitely prefer the abstract base class approach.
|