Package org.hibernate.query.spi
Interface QueryProducerImplementor
-
- All Superinterfaces:
QueryProducer
- All Known Subinterfaces:
EventSource
,SessionImplementor
,SharedSessionContractImplementor
- All Known Implementing Classes:
AbstractDelegateSessionImplementor
,AbstractSharedSessionContract
,SessionDelegatorBaseImpl
,SessionImpl
,SharedSessionDelegatorBaseImpl
,StatelessSessionImpl
,ToOneDelegateSessionImplementor
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 Deprecated Methods Modifier and Type Method Description MutationQuery
createMutationQuery(CriteriaDelete deleteQuery)
Create aMutationQuery
from the given delete criteria treeMutationQuery
createMutationQuery(CriteriaUpdate updateQuery)
Create aMutationQuery
from the given update criteria treeMutationQuery
createMutationQuery(String statementString)
Create a MutationQuery reference for the given HQL insert, update, or delete statement.MutationQuery
createNamedMutationQuery(String name)
Create aMutationQuery
instance for the given named insert, update, or delete HQL query.QueryImplementor
createNamedQuery(String name)
Deprecated.<R> QueryImplementor<R>
createNamedQuery(String name, Class<R> resultClass)
Create a typedQuery
instance for the given named query.MutationQuery
createNativeMutationQuery(String sqlString)
Create aNativeQuery
instance for the given native SQL statement.NativeQueryImplementor
createNativeQuery(String sqlString)
Deprecated.<R> NativeQueryImplementor<R>
createNativeQuery(String sqlString, Class<R> resultClass)
Create aNativeQuery
instance for the given native SQL query using implicit mapping to the specified Java type.<R> NativeQueryImplementor<R>
createNativeQuery(String sqlString, Class<R> resultClass, String tableAlias)
Create aNativeQuery
instance for the given native SQL query using implicit mapping to the specified Java type.NativeQueryImplementor
createNativeQuery(String sqlString, String resultSetMappingName)
Deprecated.<R> NativeQueryImplementor<R>
createNativeQuery(String sqlString, String resultSetMappingName, Class<R> resultClass)
Create aNativeQuery
instance for the given native SQL query using an explicit mapping to the specified Java type.QueryImplementor
createQuery(CriteriaDelete deleteQuery)
Deprecated.<R> QueryImplementor<R>
createQuery(CriteriaQuery<R> criteriaQuery)
Create aQuery
for the given JPACriteriaQuery
.QueryImplementor
createQuery(CriteriaUpdate updateQuery)
Deprecated.QueryImplementor
createQuery(String queryString)
Deprecated.<R> QueryImplementor<R>
createQuery(String queryString, Class<R> resultClass)
Create a typedQuery
instance for the given HQL query string.CacheMode
getCacheMode()
SessionFactoryImplementor
getFactory()
FlushMode
getHibernateFlushMode()
NativeQueryImplementor
getNamedNativeQuery(String name)
Deprecated.NativeQueryImplementor
getNamedNativeQuery(String name, String resultSetMapping)
Deprecated.QueryImplementor
getNamedQuery(String queryName)
Create aQuery
instance for the named query.-
Methods inherited from interface org.hibernate.query.QueryProducer
createMutationQuery, createNamedSelectionQuery, createNamedSelectionQuery, createSelectionQuery, createSelectionQuery, createSelectionQuery
-
-
-
-
Method Detail
-
getFactory
SessionFactoryImplementor getFactory()
-
getHibernateFlushMode
FlushMode getHibernateFlushMode()
-
getCacheMode
CacheMode getCacheMode()
-
getNamedQuery
QueryImplementor getNamedQuery(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
@Deprecated QueryImplementor createQuery(String queryString)
Deprecated.Description copied from interface:QueryProducer
Create aQuery
instance for the given HQL query, or HQL insert, update, or delete statement.- Specified by:
createQuery
in interfaceQueryProducer
- Parameters:
queryString
- The HQL query- Returns:
- The
Query
instance for manipulation and execution - See Also:
EntityManager.createQuery(String)
-
createQuery
<R> QueryImplementor<R> createQuery(String queryString, Class<R> resultClass)
Description copied from interface:QueryProducer
Create a typedQuery
instance for the given HQL query string.The returned
Query
may be executed by callingQuery.getResultList()
orQuery.getSingleResult()
.- Specified by:
createQuery
in interfaceQueryProducer
- Parameters:
queryString
- The HQL queryresultClass
- The type of the query result- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createQuery(String,Class)
-
createNamedQuery
@Deprecated QueryImplementor createNamedQuery(String name)
Deprecated.Description copied from interface:QueryProducer
Create a typedQuery
instance for the given named query. The named query might be defined in HQL or in native SQL.- 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(String name, Class<R> resultClass)
Description copied from interface:QueryProducer
Create a typedQuery
instance for the given named query. The named query might be defined in HQL or in native SQL.- 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
@Deprecated NativeQueryImplementor createNativeQuery(String sqlString)
Deprecated.Description copied from interface:QueryProducer
Create aNativeQuery
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
<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, Class<R> resultClass)
Description copied from interface:QueryProducer
Create aNativeQuery
instance for the given native SQL query using implicit mapping to the specified Java type.If the given class is an entity class, this method is equivalent to
createNativeQuery(sqlString).addEntity("alias1", resultClass)
.- Specified by:
createNativeQuery
in interfaceQueryProducer
- Parameters:
sqlString
- The native (SQL) query stringresultClass
- The Java entity type to map results to- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String,Class)
-
createNativeQuery
<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, Class<R> resultClass, String tableAlias)
Description copied from interface:QueryProducer
Create aNativeQuery
instance for the given native SQL query using implicit mapping to the specified Java type.If the given class is an entity class, this method is equivalent to
createNativeQuery(sqlString).addEntity(tableAlias, resultClass)
.- Specified by:
createNativeQuery
in interfaceQueryProducer
- Parameters:
sqlString
- Native (SQL) query stringresultClass
- The Java entity type to map results totableAlias
- The table alias for columns in the result set- Returns:
- The
NativeQuery
instance for manipulation and execution - See Also:
EntityManager.createNativeQuery(String,Class)
-
createNativeQuery
@Deprecated NativeQueryImplementor createNativeQuery(String sqlString, String resultSetMappingName)
Deprecated.Description copied from interface:QueryProducer
Create aNativeQuery
instance for the given native SQL query using an explicit mapping to the specified Java type.The given result set mapping name must identify a mapping defined by a
SqlResultSetMapping
annotation.- Specified by:
createNativeQuery
in interfaceQueryProducer
- Parameters:
sqlString
- The native (SQL) query stringresultSetMappingName
- The explicit result mapping name- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String,Class)
,SqlResultSetMapping
-
createNativeQuery
<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, String resultSetMappingName, Class<R> resultClass)
Description copied from interface:QueryProducer
Create aNativeQuery
instance for the given native SQL query using an explicit mapping to the specified Java type.The given result set mapping name must identify a mapping defined by a
SqlResultSetMapping
annotation.- Specified by:
createNativeQuery
in interfaceQueryProducer
- Parameters:
sqlString
- The native (SQL) query stringresultSetMappingName
- The explicit result mapping name- Returns:
- The
NativeQuery
instance for manipulation and execution - See Also:
EntityManager.createNativeQuery(String,Class)
,SqlResultSetMapping
-
getNamedNativeQuery
@Deprecated NativeQueryImplementor getNamedNativeQuery(String name)
Deprecated.Description copied from interface:QueryProducer
Get aNativeQuery
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
-
getNamedNativeQuery
@Deprecated NativeQueryImplementor getNamedNativeQuery(String name, String resultSetMapping)
Deprecated.Description copied from interface:QueryProducer
Get aNativeQuery
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
-
createMutationQuery
MutationQuery createMutationQuery(String statementString)
Description copied from interface:QueryProducer
Create a MutationQuery reference for the given HQL insert, update, or delete statement.- Specified by:
createMutationQuery
in interfaceQueryProducer
-
createNamedMutationQuery
MutationQuery createNamedMutationQuery(String name)
Description copied from interface:QueryProducer
Create aMutationQuery
instance for the given named insert, update, or delete HQL query. The named query might be defined as HQL) or native-SQL.- Specified by:
createNamedMutationQuery
in interfaceQueryProducer
-
createNativeMutationQuery
MutationQuery createNativeMutationQuery(String sqlString)
Description copied from interface:QueryProducer
Create aNativeQuery
instance for the given native SQL statement.- Specified by:
createNativeMutationQuery
in interfaceQueryProducer
- Parameters:
sqlString
- a native SQL statement string- Returns:
- The NativeQuery instance for manipulation and execution
-
createMutationQuery
MutationQuery createMutationQuery(CriteriaUpdate updateQuery)
Description copied from interface:QueryProducer
Create aMutationQuery
from the given update criteria tree- Specified by:
createMutationQuery
in interfaceQueryProducer
-
createMutationQuery
MutationQuery createMutationQuery(CriteriaDelete deleteQuery)
Description copied from interface:QueryProducer
Create aMutationQuery
from the given delete criteria tree- Specified by:
createMutationQuery
in interfaceQueryProducer
-
createQuery
<R> QueryImplementor<R> createQuery(CriteriaQuery<R> criteriaQuery)
Description copied from interface:QueryProducer
Create aQuery
for the given JPACriteriaQuery
.- Specified by:
createQuery
in interfaceQueryProducer
-
createQuery
@Deprecated QueryImplementor createQuery(CriteriaUpdate updateQuery)
Deprecated.Description copied from interface:QueryProducer
Create aMutationQuery
for the given JPACriteriaUpdate
- Specified by:
createQuery
in interfaceQueryProducer
-
createQuery
@Deprecated QueryImplementor createQuery(CriteriaDelete deleteQuery)
Deprecated.Description copied from interface:QueryProducer
Create aMutationQuery
for the given JPACriteriaDelete
- Specified by:
createQuery
in interfaceQueryProducer
-
-