In an inheritance hierarchy a mapped superclass causes a query to fail if the `TYPE` operator is used, e.g. `SELECT x from B x WHERE TYPE = B` fails with `org.hibernate.QueryException: could not resolve property: class of: de.richtercloud.type.operator.nonsense.B` (B is a subclass of A, both POJOs) if A is a mapped superclass and only succeeds if A is an entity. This doesn't correspond to the JPA 2.1 `TYPE` operator specification. A minimal example for the issue can be found at https://github.com/krichter722/type-operator-nonsense at commit f5909c7. The example allows to easily switch to OpenJPA which works fine. |