HHH-8477 use unwrapped query

This commit is contained in:
Scott Marlow 2013-10-17 09:21:00 -04:00
parent a1e3849e5d
commit 381198c206
1 changed files with 1 additions and 1 deletions

View File

@ -401,7 +401,7 @@ public class EntityManagerFactoryImpl implements HibernateEntityManagerFactory {
final HibernateQuery unwrapped = query.unwrap( HibernateQuery.class ); final HibernateQuery unwrapped = query.unwrap( HibernateQuery.class );
if ( unwrapped != null ) { if ( unwrapped != null ) {
// create and register the proper NamedQueryDefinition... // create and register the proper NamedQueryDefinition...
final org.hibernate.Query hibernateQuery = ( (HibernateQuery) query ).getHibernateQuery(); final org.hibernate.Query hibernateQuery = unwrapped.getHibernateQuery();
if ( org.hibernate.SQLQuery.class.isInstance( hibernateQuery ) ) { if ( org.hibernate.SQLQuery.class.isInstance( hibernateQuery ) ) {
sessionFactory.registerNamedSQLQueryDefinition( sessionFactory.registerNamedSQLQueryDefinition(
name, name,