I\'m using Hibernate 3.1.1, and in particular, I\'m using HQL queries.
According to the documentation, Hibernate\'s queries are polymorphic:
A
Look at BaseQueryReturnFieldsCalculatorGC; it dynamically adds a condition to the 'where' which selects only where class=XXX; you can duplicate this logic to the HQLQueryTemplate and have the user define 'isNonPolymorphic'.
Note that it will only work with table-per-hierarchy, cos only then does the implicit class column exist and is selectable.