Package org.hibernate.query.spi
Interface QueryProducerImplementor
-
- All Superinterfaces:
QueryProducer
- All Known Subinterfaces:
EventSource
,SessionImplementor
,SharedSessionContractImplementor
- All Known Implementing Classes:
SessionDelegatorBaseImpl
public interface QueryProducerImplementor extends QueryProducer
The internal contract for QueryProducer implementations. Acts as the value passed to produced queries and provides them with access to needed functionality.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Query
createNamedQuery(java.lang.String name)
The JPA-defined named query creation method.<R> QueryImplementor<R>
createNamedQuery(java.lang.String name, java.lang.Class<R> resultClass)
The JPA-defined named, typed query creation method.NativeQueryImplementor
createNativeQuery(java.lang.String sqlString)
Create a NativeQuery instance for the given native (SQL) queryNativeQueryImplementor
createNativeQuery(java.lang.String sqlString, java.lang.Class resultClass)
Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.NativeQueryImplementor
createNativeQuery(java.lang.String sqlString, java.lang.String resultSetMapping)
Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.QueryImplementor
createQuery(java.lang.String queryString)
Create aQuery
instance for the given HQL/JPQL query string.<R> QueryImplementor<R>
createQuery(java.lang.String queryString, java.lang.Class<R> resultClass)
Create a typedQuery
instance for the given HQL/JPQL query string.default NativeQueryImplementor
createSQLQuery(java.lang.String queryString)
Create aNativeQuery
instance for the given SQL query string.CacheMode
getCacheMode()
SessionFactoryImplementor
getFactory()
FlushMode
getHibernateFlushMode()
NativeQueryImplementor
getNamedNativeQuery(java.lang.String name)
Get a NativeQuery instance for a named native SQL queryQueryImplementor
getNamedQuery(java.lang.String queryName)
Create aQuery
instance for the named query.default NativeQueryImplementor
getNamedSQLQuery(java.lang.String name)
Get a NativeQuery instance for a named native SQL query
-
-
-
Method Detail
-
getFactory
SessionFactoryImplementor getFactory()
-
getHibernateFlushMode
FlushMode getHibernateFlushMode()
-
getCacheMode
CacheMode getCacheMode()
-
getNamedQuery
QueryImplementor getNamedQuery(java.lang.String queryName)
Description copied from interface:QueryProducer
Create aQuery
instance for the named query.- Specified by:
getNamedQuery
in interfaceQueryProducer
- Parameters:
queryName
- the name of a pre-defined, named query- Returns:
- The Query instance for manipulation and execution
-
createQuery
QueryImplementor createQuery(java.lang.String queryString)
Description copied from interface:QueryProducer
Create aQuery
instance for the given HQL/JPQL query string.- Specified by:
createQuery
in interfaceQueryProducer
- Parameters:
queryString
- The HQL/JPQL query- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createQuery(String)
-
createQuery
<R> QueryImplementor<R> createQuery(java.lang.String queryString, java.lang.Class<R> resultClass)
Description copied from interface:QueryProducer
Create a typedQuery
instance for the given HQL/JPQL query string.- Specified by:
createQuery
in interfaceQueryProducer
- Parameters:
queryString
- The HQL/JPQL query- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createQuery(String,Class)
-
createNamedQuery
Query createNamedQuery(java.lang.String name)
Description copied from interface:QueryProducer
The JPA-defined named query creation method. This form can represent an HQL/JPQL query or a native query.- Specified by:
createNamedQuery
in interfaceQueryProducer
- Parameters:
name
- the name of a pre-defined, named query- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createNamedQuery(String)
-
createNamedQuery
<R> QueryImplementor<R> createNamedQuery(java.lang.String name, java.lang.Class<R> resultClass)
Description copied from interface:QueryProducer
The JPA-defined named, typed query creation method. This form can only represent an HQL/JPQL query (not a native query).- Specified by:
createNamedQuery
in interfaceQueryProducer
- Parameters:
name
- the name of a query defined in metadataresultClass
- the type of the query result- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createNamedQuery(String,Class)
-
createNativeQuery
NativeQueryImplementor createNativeQuery(java.lang.String sqlString)
Description copied from interface:QueryProducer
Create a NativeQuery instance for the given native (SQL) query- Specified by:
createNativeQuery
in interfaceQueryProducer
- Parameters:
sqlString
- a native SQL query string- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String)
-
createNativeQuery
NativeQueryImplementor createNativeQuery(java.lang.String sqlString, java.lang.Class resultClass)
Description copied from interface:QueryProducer
Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- Specified by:
createNativeQuery
in interfaceQueryProducer
- Parameters:
sqlString
- Native (SQL) query stringresultClass
- The Java type to map results to- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String,Class)
-
createNativeQuery
NativeQueryImplementor createNativeQuery(java.lang.String sqlString, java.lang.String resultSetMapping)
Description copied from interface:QueryProducer
Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- Specified by:
createNativeQuery
in interfaceQueryProducer
- Parameters:
sqlString
- Native (SQL) query stringresultSetMapping
- The explicit (named) result mapping- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String,Class)
,SqlResultSetMapping
-
getNamedNativeQuery
NativeQueryImplementor getNamedNativeQuery(java.lang.String name)
Description copied from interface:QueryProducer
Get a NativeQuery instance for a named native SQL query- Specified by:
getNamedNativeQuery
in interfaceQueryProducer
- Parameters:
name
- The name of the pre-defined query- Returns:
- The NativeQuery instance for manipulation and execution
-
getNamedSQLQuery
default NativeQueryImplementor getNamedSQLQuery(java.lang.String name)
Description copied from interface:QueryProducer
Get a NativeQuery instance for a named native SQL query- Specified by:
getNamedSQLQuery
in interfaceQueryProducer
- Parameters:
name
- The name of the pre-defined query- Returns:
- The NativeQuery instance for manipulation and execution
-
createSQLQuery
default NativeQueryImplementor createSQLQuery(java.lang.String queryString)
Description copied from interface:QueryProducer
Create aNativeQuery
instance for the given SQL query string.- Specified by:
createSQLQuery
in interfaceQueryProducer
- Parameters:
queryString
- The SQL query- Returns:
- The query instance for manipulation and execution
-
-