diff --git a/hibernate-core/src/main/java/org/hibernate/Session.java b/hibernate-core/src/main/java/org/hibernate/Session.java index e16b9b9f59..36b334b462 100644 --- a/hibernate-core/src/main/java/org/hibernate/Session.java +++ b/hibernate-core/src/main/java/org/hibernate/Session.java @@ -18,6 +18,7 @@ import javax.persistence.criteria.CriteriaUpdate; import org.hibernate.jdbc.ReturningWork; import org.hibernate.jdbc.Work; import org.hibernate.jpa.HibernateEntityManager; +import org.hibernate.query.NativeQuery; import org.hibernate.stat.SessionStatistics; /** @@ -1157,5 +1158,11 @@ public interface Session extends SharedSessionContract, EntityManager, Hibernate @Override org.hibernate.query.Query createQuery(CriteriaDelete deleteQuery); + @Override + org.hibernate.query.Query getNamedQuery(String queryName); + org.hibernate.query.Query createNamedQuery(String name, Class resultType); + + @Override + NativeQuery createSQLQuery(String queryString); } diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionImplementor.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionImplementor.java index 685fc834e8..95e9776fc5 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionImplementor.java @@ -91,6 +91,9 @@ public interface SessionImplementor @Override NativeQueryImplementor createNativeQuery(String sqlString, String resultSetMapping); + @Override + NativeQueryImplementor createSQLQuery(String sqlString); + @Override NativeQueryImplementor getNamedNativeQuery(String name); diff --git a/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java b/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java index 9e746fe1f9..e170be5139 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java +++ b/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java @@ -6,6 +6,8 @@ */ package org.hibernate.query; +import org.hibernate.SQLQuery; + /** * Contract for things that can produce Query instances. Expected implementors include * Session and StatelessSession. @@ -27,7 +29,7 @@ public interface QueryProducer { * defined with the given name or if the query string is * found to be invalid */ - Query getNamedQuery(String queryName); + org.hibernate.Query getNamedQuery(String queryName); /** * Create a {@link Query} instance for the given HQL/JPQL query string. @@ -38,7 +40,7 @@ public interface QueryProducer { * * @see javax.persistence.EntityManager#createQuery(String) */ - Query createQuery(String queryString); + org.hibernate.Query createQuery(String queryString); /** * Create a typed {@link Query} instance for the given HQL/JPQL query string. @@ -95,7 +97,7 @@ public interface QueryProducer { * @deprecated (since 5.2) use {@link #createNativeQuery(String)} instead */ @Deprecated - default NativeQuery createSQLQuery(String queryString) { + default SQLQuery createSQLQuery(String queryString) { NativeQuery query = createNativeQuery( queryString ); query.setComment( "dynamic native SQL query" ); return query; @@ -149,7 +151,7 @@ public interface QueryProducer { * @deprecated (since 5.2) use {@link #getNamedNativeQuery(String)} instead */ @Deprecated - default NativeQuery getNamedSQLQuery(String name) { + default org.hibernate.Query getNamedSQLQuery(String name) { return getNamedNativeQuery( name ); }