Hi all,
I'm using Hibernate 3.3, and in particular, I'm using HQL queries.
According to the documentation, Hibernate's queries are polymorphic:
Quote:
A query like: from Cat as cat returns instances not only of Cat, but also of subclasses like DomesticCat.
How can I query for instances of Cat, but not of any of its subclasses?
I'm aware of the following options, and don't find them satisfactory:
1. Manually filtering the instances after the query, OR:
2. Manually adding a WHERE clause on the discriminator column.
I've read in other places that 'WHERE bean.class = myClass' is meant to work, but it doesn't.
It would make sense for Hibernate to allow the user to decide whether a query should be polymorphic or not, but I can't find such an option.
Thanks in advance!