Package org.hibernate.reactive.mutiny
Interface Mutiny.QueryProducer
- All Known Subinterfaces:
Mutiny.Session
,Mutiny.StatelessSession
- All Known Implementing Classes:
MutinySessionDelegator
,MutinyStatelessSessionDelegator
- Enclosing interface:
- Mutiny
public static interface Mutiny.QueryProducer
Operations common to objects which act as factories for instances of
Mutiny.Query
. This is a common supertype of Mutiny.Session
and
Mutiny.StatelessSession
.- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescription<T> jakarta.persistence.EntityGraph<T>
createEntityGraph
(Class<T> rootType) Create a new mutableEntityGraph
<T> jakarta.persistence.EntityGraph<T>
createEntityGraph
(Class<T> rootType, String graphName) Create a new mutable copy of a namedEntityGraph
createMutationQuery
(jakarta.persistence.criteria.CriteriaDelete<?> deleteQuery) Create an instance ofMutiny.MutationQuery
for the given delete tree.createMutationQuery
(jakarta.persistence.criteria.CriteriaUpdate<?> updateQuery) Create an instance ofMutiny.MutationQuery
for the given update tree.createMutationQuery
(String queryString) Create an instance ofMutiny.MutationQuery
for the given HQL/JPQL update or delete statement.createMutationQuery
(JpaCriteriaInsert<?> insert) Create aMutiny.MutationQuery
from the given insert select criteria tree<R> Mutiny.Query<R>
createNamedQuery
(String queryName) Create an instance ofMutiny.Query
for the named query.<R> Mutiny.SelectionQuery<R>
createNamedQuery
(String queryName, Class<R> resultType) Create an instance ofMutiny.SelectionQuery
for the named query.<R> Mutiny.Query<R>
createNativeQuery
(String queryString) Create an instance ofMutiny.Query
for the given SQL query string, or SQL update, insert, or delete statement.<R> Mutiny.SelectionQuery<R>
createNativeQuery
(String queryString, Class<R> resultType) Create an instance ofMutiny.SelectionQuery
for the given SQL query string, using the givenresultType
to interpret the results.<R> Mutiny.SelectionQuery<R>
createNativeQuery
(String queryString, Class<R> resultType, AffectedEntities affectedEntities) Create an instance ofMutiny.SelectionQuery
for the given SQL query string, using the givenresultType
to interpret the results.<R> Mutiny.Query<R>
createNativeQuery
(String queryString, AffectedEntities affectedEntities) Create an instance ofMutiny.Query
for the given SQL query string, or SQL update, insert, or delete statement.<R> Mutiny.SelectionQuery<R>
createNativeQuery
(String queryString, ResultSetMapping<R> resultSetMapping) Create an instance ofMutiny.SelectionQuery
for the given SQL query string, using the givenResultSetMapping
to interpret the result set.<R> Mutiny.SelectionQuery<R>
createNativeQuery
(String queryString, ResultSetMapping<R> resultSetMapping, AffectedEntities affectedEntities) Create an instance ofMutiny.SelectionQuery
for the given SQL query string, using the givenResultSetMapping
to interpret the result set.createQuery
(jakarta.persistence.criteria.CriteriaDelete<R> criteriaDelete) Create an instance ofMutiny.MutationQuery
for the given criteria delete.<R> Mutiny.SelectionQuery<R>
createQuery
(jakarta.persistence.criteria.CriteriaQuery<R> criteriaQuery) Create an instance ofMutiny.SelectionQuery
for the given criteria query.createQuery
(jakarta.persistence.criteria.CriteriaUpdate<R> criteriaUpdate) Create an instance ofMutiny.MutationQuery
for the given criteria update.<R> Mutiny.Query<R>
createQuery
(jakarta.persistence.TypedQueryReference<R> typedQueryReference) Create a typedQuery
instance for the given typed query reference.<R> Mutiny.Query<R>
createQuery
(String queryString) Deprecated.<R> Mutiny.SelectionQuery<R>
createQuery
(String queryString, Class<R> resultType) Create an instance ofMutiny.SelectionQuery
for the given HQL/JPQL query string and query result type.<R> Mutiny.SelectionQuery<R>
createSelectionQuery
(String queryString, Class<R> resultType) Create an instance ofMutiny.SelectionQuery
for the given HQL/JPQL query string.jakarta.persistence.criteria.CriteriaBuilder
Convenience method to obtain theCriteriaBuilder
.<T> jakarta.persistence.EntityGraph<T>
getEntityGraph
(Class<T> rootType, String graphName) Obtain a namedEntityGraph
<T> ResultSetMapping<T>
getResultSetMapping
(Class<T> resultType, String mappingName) Obtain a native SQL result set mapping defined via the annotationSqlResultSetMapping
.
-
Method Details
-
createSelectionQuery
Create an instance ofMutiny.SelectionQuery
for the given HQL/JPQL query string.- Parameters:
queryString
- The HQL/JPQL query- Returns:
- The
Mutiny.SelectionQuery
instance for manipulation and execution - See Also:
-
EntityManager.createQuery(String, Class)
-
createQuery
Create a typedQuery
instance for the given typed query reference.- Parameters:
typedQueryReference
- the type query reference- Returns:
- The
Query
instance for execution - Throws:
IllegalArgumentException
- if a query has not been defined with the name of the typed query reference or if the query result is found to not be assignable to result class of the typed query reference- See Also:
-
createMutationQuery
Create an instance ofMutiny.MutationQuery
for the given HQL/JPQL update or delete statement.- Parameters:
queryString
- The HQL/JPQL query, update or delete statement- Returns:
- The
Mutiny.MutationQuery
instance for manipulation and execution - See Also:
-
EntityManager.createQuery(String)
-
createMutationQuery
Mutiny.MutationQuery createMutationQuery(jakarta.persistence.criteria.CriteriaUpdate<?> updateQuery) Create an instance ofMutiny.MutationQuery
for the given update tree.- Parameters:
updateQuery
- the update criteria query- Returns:
- The
Mutiny.MutationQuery
instance for manipulation and execution - See Also:
-
createMutationQuery
Mutiny.MutationQuery createMutationQuery(jakarta.persistence.criteria.CriteriaDelete<?> deleteQuery) Create an instance ofMutiny.MutationQuery
for the given delete tree.- Parameters:
deleteQuery
- the delete criteria query- Returns:
- The
Mutiny.MutationQuery
instance for manipulation and execution - See Also:
-
createMutationQuery
Create aMutiny.MutationQuery
from the given insert select criteria tree- Parameters:
insert
- the insert select criteria query- Returns:
- The
Mutiny.MutationQuery
instance for manipulation and execution - See Also:
-
createQuery
Deprecated.See explanation inQueryProducer.createSelectionQuery(String)
Create an instance ofMutiny.Query
for the given HQL/JPQL query string or HQL/JPQL update or delete statement. In the case of an update or delete, the returnedMutiny.Query
must be executed usingMutiny.MutationQuery.executeUpdate()
which returns an affected row count.- Parameters:
queryString
- The HQL/JPQL query, update or delete statement- Returns:
- The
Mutiny.Query
instance for manipulation and execution - See Also:
-
EntityManager.createQuery(String)
-
createQuery
Create an instance ofMutiny.SelectionQuery
for the given HQL/JPQL query string and query result type.- Parameters:
queryString
- The HQL/JPQL queryresultType
- the Java type returned in each row of query results- Returns:
- The
Mutiny.SelectionQuery
instance for manipulation and execution - See Also:
-
EntityManager.createQuery(String, Class)
-
createQuery
<R> Mutiny.SelectionQuery<R> createQuery(jakarta.persistence.criteria.CriteriaQuery<R> criteriaQuery) Create an instance ofMutiny.SelectionQuery
for the given criteria query.- Parameters:
criteriaQuery
- TheCriteriaQuery
- Returns:
- The
Mutiny.SelectionQuery
instance for manipulation and execution - See Also:
-
EntityManager.createQuery(String)
-
createQuery
Create an instance ofMutiny.MutationQuery
for the given criteria update.- Parameters:
criteriaUpdate
- TheCriteriaUpdate
- Returns:
- The
Mutiny.MutationQuery
instance for manipulation and execution
-
createQuery
Create an instance ofMutiny.MutationQuery
for the given criteria delete.- Parameters:
criteriaDelete
- TheCriteriaDelete
- Returns:
- The
Mutiny.MutationQuery
instance for manipulation and execution
-
createNamedQuery
Create an instance ofMutiny.Query
for the named query.- Parameters:
queryName
- The name of the query- Returns:
- The
Mutiny.Query
instance for manipulation and execution - See Also:
-
EntityManager.createQuery(String)
-
createNamedQuery
Create an instance ofMutiny.SelectionQuery
for the named query.- Parameters:
queryName
- The name of the queryresultType
- the Java type returned in each row of query results- Returns:
- The
Mutiny.SelectionQuery
instance for manipulation and execution - See Also:
-
EntityManager.createQuery(String, Class)
-
createNativeQuery
Create an instance ofMutiny.Query
for the given SQL query string, or SQL update, insert, or delete statement. In the case of an update, insert, or delete, the returnedMutiny.Query
must be executed usingMutiny.MutationQuery.executeUpdate()
which returns an affected row count. In the case of a query:- If the result set has a single column, the results will be returned as scalars.
- Otherwise, if the result set has multiple columns, the results will
be returned as elements of arrays of type
Object[]
.
- Parameters:
queryString
- The SQL select, update, insert, or delete statement
-
createNativeQuery
Create an instance ofMutiny.Query
for the given SQL query string, or SQL update, insert, or delete statement. In the case of an update, insert, or delete, the returnedMutiny.Query
must be executed usingMutiny.MutationQuery.executeUpdate()
which returns an affected row count. In the case of a query:- If the result set has a single column, the results will be returned as scalars.
- Otherwise, if the result set has multiple columns, the results will
be returned as elements of arrays of type
Object[]
.
Any
affected entities
are synchronized with the database before execution of the statement.- Parameters:
queryString
- The SQL select, update, insert, or delete statementaffectedEntities
- The entities which are affected by the statement
-
createNativeQuery
Create an instance ofMutiny.SelectionQuery
for the given SQL query string, using the givenresultType
to interpret the results.- If the given result type is
Object
, or a built-in type such asString
orInteger
, the result set must have a single column, which will be returned as a scalar. - If the given result type is
Object[]
, then the result set must have multiple columns, which will be returned in arrays. - Otherwise, the given result type must be an entity class, in which case the result set column aliases must map to the fields of the entity, and the query will return instances of the entity.
- Parameters:
queryString
- The SQL queryresultType
- the Java type returned in each row of query results- Returns:
- The
Mutiny.SelectionQuery
instance for manipulation and execution - See Also:
-
EntityManager.createNativeQuery(String, Class)
- If the given result type is
-
createNativeQuery
<R> Mutiny.SelectionQuery<R> createNativeQuery(String queryString, Class<R> resultType, AffectedEntities affectedEntities) Create an instance ofMutiny.SelectionQuery
for the given SQL query string, using the givenresultType
to interpret the results.- If the given result type is
Object
, or a built-in type such asString
orInteger
, the result set must have a single column, which will be returned as a scalar. - If the given result type is
Object[]
, then the result set must have multiple columns, which will be returned in arrays. - Otherwise, the given result type must be an entity class, in which case the result set column aliases must map to the fields of the entity, and the query will return instances of the entity.
Any
affected entities
are synchronized with the database before execution of the query.- Parameters:
queryString
- The SQL queryresultType
- the Java type returned in each row of query resultsaffectedEntities
- The entities which are affected by the query- Returns:
- The
Mutiny.Query
instance for manipulation and execution - See Also:
-
EntityManager.createNativeQuery(String, Class)
- If the given result type is
-
createNativeQuery
<R> Mutiny.SelectionQuery<R> createNativeQuery(String queryString, ResultSetMapping<R> resultSetMapping) Create an instance ofMutiny.SelectionQuery
for the given SQL query string, using the givenResultSetMapping
to interpret the result set.- Parameters:
queryString
- The SQL queryresultSetMapping
- the result set mapping- Returns:
- The
Mutiny.Query
instance for manipulation and execution - See Also:
-
getResultSetMapping(Class, String)
EntityManager.createNativeQuery(String, String)
-
createNativeQuery
<R> Mutiny.SelectionQuery<R> createNativeQuery(String queryString, ResultSetMapping<R> resultSetMapping, AffectedEntities affectedEntities) Create an instance ofMutiny.SelectionQuery
for the given SQL query string, using the givenResultSetMapping
to interpret the result set.Any
affected entities
are synchronized with the database before execution of the query.- Parameters:
queryString
- The SQL queryresultSetMapping
- the result set mappingaffectedEntities
- The entities which are affected by the query- Returns:
- The
Mutiny.SelectionQuery
instance for manipulation and execution - See Also:
-
getResultSetMapping(Class, String)
EntityManager.createNativeQuery(String, String)
-
getResultSetMapping
Obtain a native SQL result set mapping defined via the annotationSqlResultSetMapping
. -
getEntityGraph
Obtain a namedEntityGraph
-
createEntityGraph
Create a new mutableEntityGraph
-
createEntityGraph
Create a new mutable copy of a namedEntityGraph
-
getCriteriaBuilder
jakarta.persistence.criteria.CriteriaBuilder getCriteriaBuilder()Convenience method to obtain theCriteriaBuilder
.- Since:
- 3
-
QueryProducer.createSelectionQuery(String)