Interface QueryProducerImplementor
- All Superinterfaces:
QueryProducer
- All Known Subinterfaces:
EventSource,SessionImplementor,SharedSessionContractImplementor
- All Known Implementing Classes:
AbstractDelegateSessionImplementor,AbstractSharedSessionContract,SessionDelegatorBaseImpl,SessionImpl,SharedSessionDelegatorBaseImpl,StatelessSessionImpl,ToOneDelegateSessionImplementor
QueryProducer implementations.-
Method Summary
Modifier and TypeMethodDescriptioncreateMutationQuery(CriteriaDelete deleteQuery) Deprecated, for removal: This API element is subject to removal in a future version.Create aMutationQueryfrom the given delete criteria treecreateMutationQuery(CriteriaUpdate updateQuery) Deprecated, for removal: This API element is subject to removal in a future version.Create aMutationQueryfrom the given update criteria treecreateMutationQuery(String statementString) Deprecated, for removal: This API element is subject to removal in a future version.Create aMutationQueryreference for the given HQL insert, update, or delete statement.Deprecated, for removal: This API element is subject to removal in a future version.Create aMutationQueryinstance for the given named insert, update, or delete HQL query.createNamedQuery(String name) Deprecated.<R> QueryImplementor<R> createNamedQuery(String name, Class<R> resultClass) Deprecated, for removal: This API element is subject to removal in a future version.Create a typedQueryinstance for the given named query.createNativeMutationQuery(String sqlString) Deprecated, for removal: This API element is subject to removal in a future version.Create aNativeQueryinstance for the given native SQL statement.createNativeQuery(String sqlString) Deprecated.<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, Class<R> resultClass) Deprecated, for removal: This API element is subject to removal in a future version.Create aNativeQueryinstance for the given native SQL query using an implicit mapping to the specified Java type.<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, Class<R> resultClass, String tableAlias) Deprecated, for removal: This API element is subject to removal in a future version.Create aNativeQueryinstance for the given native SQL query using an implicit mapping to the specified Java entity type.createNativeQuery(String sqlString, String resultSetMappingName) Deprecated.<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, String resultSetMappingName, Class<R> resultClass) Deprecated, for removal: This API element is subject to removal in a future version.Create aNativeQueryinstance for the given native SQL query using an explicit mapping to the specified Java type.createQuery(CriteriaDelete deleteQuery) Deprecated.<R> QueryImplementor<R> createQuery(CriteriaQuery<R> criteriaQuery) Deprecated, for removal: This API element is subject to removal in a future version.Create aQueryfor the given JPACriteriaQuery.createQuery(CriteriaUpdate updateQuery) Deprecated.<R> QueryImplementor<R> createQuery(TypedQueryReference<R> typedQueryReference) Deprecated, for removal: This API element is subject to removal in a future version.Create a typedQueryinstance for the given typed query reference.createQuery(String queryString) Deprecated.<R> QueryImplementor<R> createQuery(String queryString, Class<R> resultClass) Deprecated, for removal: This API element is subject to removal in a future version.Create a typedQueryinstance for the given HQL query string and given query result type.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.getNamedNativeQuery(String name) Deprecated.getNamedNativeQuery(String name, String resultSetMapping) Deprecated.getNamedQuery(String queryName) Deprecated, for removal: This API element is subject to removal in a future version.Create aQueryinstance for the named query.Methods inherited from interface org.hibernate.query.QueryProducer
createMutationQuery, createNamedSelectionQuery, createNamedSelectionQuery, createSelectionQuery, createSelectionQuery, createSelectionQuery, createSelectionQuery
-
Method Details
-
getFactory
SessionFactoryImplementor getFactory()Deprecated, for removal: This API element is subject to removal in a future version. -
getHibernateFlushMode
FlushMode getHibernateFlushMode()Deprecated, for removal: This API element is subject to removal in a future version. -
getCacheMode
CacheMode getCacheMode()Deprecated, for removal: This API element is subject to removal in a future version. -
getNamedQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aQueryinstance for the named query.- Specified by:
getNamedQueryin interfaceQueryProducer- Parameters:
queryName- the name of a predefined named query- Returns:
- The
Queryinstance for manipulation and execution
-
createQuery
Deprecated.Description copied from interface:QueryProducerCreate aQueryinstance for the given HQL query, or HQL insert, update, or delete statement.If a query has no explicit
selectlist, the select list is inferred:- if there is exactly one root entity in the
fromclause, and it has no non-fetchjoins, then that root entity is the only element of the select list, or - if there is an entity with the alias
this, then that entity is the only element of the select list, or - otherwise, the query is considered ambiguous, and this
method throws a
SemanticException.
The query must have an explicit
fromclause, which can never be inferred.- Specified by:
createQueryin interfaceQueryProducer- Parameters:
queryString- The HQL query- Returns:
- The
Queryinstance for manipulation and execution - See Also:
- if there is exactly one root entity in the
-
createQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate a typedQueryinstance for the given HQL query string and given query result type.- If the query has a single item in the
selectlist, then the select item must be assignable to the given result type. - Otherwise, if there are multiple select items, then the
select items will be packaged into an instance of the
result type. The result type must have an appropriate
constructor with parameter types matching the select items,
or it must be one of the types
Object[],List,Map, orTuple.
If a query has no explicit
selectlist, the select list is inferred from the given query result type:- if the result type is an entity type, the query must have
exactly one root entity in the
fromclause, it must be assignable to the result type, and the inferred select list will contain just that entity, or - otherwise, the select list contains every root entity and
every non-
fetchjoined entity, and each query result will be packaged into an instance of the result type, just as specified above.
If a query has no explicit
fromclause, and the given result type is an entity type, the root entity is inferred to be the result type.Passing
Object.classas the query result type is not recommended. In this special case, this method has the same semantics as the overloadQueryProducer.createQuery(String).The returned
Querymay be executed by callingQuery.getResultList()orQuery.getSingleResult().- Specified by:
createQueryin interfaceQueryProducer- Parameters:
queryString- The HQL queryresultClass- TheClassobject representing the query result type, which should not beObject.class- Returns:
- The
Queryinstance for manipulation and execution - See Also:
- If the query has a single item in the
-
createQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate a typedQueryinstance for the given typed query reference.- Specified by:
createQueryin interfaceQueryProducer- Parameters:
typedQueryReference- the type query reference- Returns:
- The
Queryinstance for execution - See Also:
-
createNamedQuery
Deprecated.Description copied from interface:QueryProducerCreate a typedQueryinstance for the given named query. The named query might be defined in HQL or in native SQL.- Specified by:
createNamedQueryin interfaceQueryProducer- Parameters:
name- the name of a predefined named query- Returns:
- The
Queryinstance for manipulation and execution - See Also:
-
createNamedQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate a typedQueryinstance for the given named query. The named query might be defined in HQL or in native SQL.- Specified by:
createNamedQueryin interfaceQueryProducer- Parameters:
name- the name of a query defined in metadataresultClass- the type of the query result- Returns:
- The
Queryinstance for manipulation and execution - See Also:
-
createNativeQuery
Deprecated.Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL query.- Specified by:
createNativeQueryin interfaceQueryProducer- Parameters:
sqlString- a native SQL query string- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
-
createNativeQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL query using an implicit mapping to the specified Java type.- If the given class is an entity class, this method is equivalent
to
createNativeQuery(sqlString).addEntity(resultClass). - If the given class has a registered
JavaType, then the query must return a result set with a single column whoseJdbcTypeis compatible with thatJavaType. - Otherwise, the select items will be packaged into an instance of
the result type. The result type must have an appropriate
constructor with parameter types matching the select items, or it
must be one of the types
Object[],List,Map, orTuple.
- Specified by:
createNativeQueryin interfaceQueryProducer- Parameters:
sqlString- The native (SQL) query stringresultClass- The Java type to map results to- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
- If the given class is an entity class, this method is equivalent
to
-
createNativeQuery
<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, Class<R> resultClass, String tableAlias) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL query using an implicit mapping to the specified Java entity type.The given class must be an entity class. This method is equivalent to
createNativeQuery(sqlString).addEntity(tableAlias, resultClass).- Specified by:
createNativeQueryin interfaceQueryProducer- Parameters:
sqlString- Native (SQL) query stringresultClass- The Java entity class to map results totableAlias- The table alias for columns in the result set- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
-
createNativeQuery
Deprecated.Description copied from interface:QueryProducerCreate aNativeQueryinstance 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
SqlResultSetMappingannotation.- Specified by:
createNativeQueryin interfaceQueryProducer- Parameters:
sqlString- The native (SQL) query stringresultSetMappingName- The explicit result mapping name- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
-
createNativeQuery
<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, String resultSetMappingName, Class<R> resultClass) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aNativeQueryinstance 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
SqlResultSetMappingannotation.- Specified by:
createNativeQueryin interfaceQueryProducer- Parameters:
sqlString- The native (SQL) query stringresultSetMappingName- The explicit result mapping name- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
-
getNamedNativeQuery
Deprecated.Description copied from interface:QueryProducerGet aNativeQueryinstance for a named native SQL query- Specified by:
getNamedNativeQueryin interfaceQueryProducer- Parameters:
name- The name of the predefined query- Returns:
- The
NativeQueryinstance for manipulation and execution
-
getNamedNativeQuery
Deprecated.Description copied from interface:QueryProducerGet aNativeQueryinstance for a named native SQL query- Specified by:
getNamedNativeQueryin interfaceQueryProducer- Parameters:
name- The name of the predefined query- Returns:
- The
NativeQueryinstance for manipulation and execution
-
createMutationQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aMutationQueryreference for the given HQL insert, update, or delete statement.- Specified by:
createMutationQueryin interfaceQueryProducer- Parameters:
statementString- The HQLinsert,update, ordeletestatement
-
createNamedMutationQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aMutationQueryinstance for the given named insert, update, or delete HQL query. The named query might be defined as HQL) or native-SQL.- Specified by:
createNamedMutationQueryin interfaceQueryProducer
-
createNativeMutationQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL statement.- Specified by:
createNativeMutationQueryin interfaceQueryProducer- Parameters:
sqlString- a native SQL statement string- Returns:
- The NativeQuery instance for manipulation and execution
-
createMutationQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aMutationQueryfrom the given update criteria tree- Specified by:
createMutationQueryin interfaceQueryProducer
-
createMutationQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aMutationQueryfrom the given delete criteria tree- Specified by:
createMutationQueryin interfaceQueryProducer
-
createQuery
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:QueryProducerCreate aQueryfor the given JPACriteriaQuery.- Specified by:
createQueryin interfaceQueryProducer
-
createQuery
Deprecated.Description copied from interface:QueryProducerCreate aMutationQueryfor the given JPACriteriaUpdate- Specified by:
createQueryin interfaceQueryProducer
-
createQuery
Deprecated.Description copied from interface:QueryProducerCreate aMutationQueryfor the given JPACriteriaDelete- Specified by:
createQueryin interfaceQueryProducer
-