I'm using the
class keyword in my HQL to check the type of a table-per-class-hierarchy mapped set of classes. Hibernate correctly resolves the embedded class name to the discriminator type when I hardcode the class name.
When I use the class name as a named parameter, either as an actual Class or as a String (class.getName()), it does not behave correctly. It seems like the query engine is creating a quoted value rather than resolving the class name.
I tried specifying the type as Hibernate.custom() and that did not seem to work. Here's my query:
Code:
from eg.Order o
where o.merchant = :merchant
and exists (from o.flowInterrupts fi where fi.class = :interruptType
and fi.subType = :interruptSubType
and fi.currentStatus.status = :status)
Any ideas? Can I pass
class as a named parameter?