This does not appear to affect 5.2.2. Holger Niehaus, this looks like an easy fix for 5.1 branch: diff --git a/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java b/hibernate-core/src/main/java/or index 643e25f..9728853 100644 — a/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java @@ -550,7 +550,7 @@ public abstract class AbstractQueryImpl implements Query { throw new HibernateException( "Could not determine a type for class: " + typename } }
- return ( (Session) session ).getTypeHelper().entity( clazz );
+ return session.getFactory().getTypeHelper().entity( clazz ); } else { return type;
Please create a pull request with an update to org.hibernate.test.stateless.StatelessSessionQueryTest that reproduces your issue along with the fix. |