Class MutinyStatelessSessionDelegator
java.lang.Object
org.hibernate.reactive.mutiny.delegation.MutinyStatelessSessionDelegator
- All Implemented Interfaces:
Mutiny.Closeable,Mutiny.QueryProducer,Mutiny.StatelessSession
public abstract class MutinyStatelessSessionDelegator
extends Object
implements Mutiny.StatelessSession
Wraps a delegate() stateless session.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>close()Close the reactive session and release the underlying database connection.<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 namedEntityGraphcreateMutationQuery(jakarta.persistence.criteria.CriteriaDelete<?> deleteQuery) Create an instance ofMutiny.MutationQueryfor the given delete tree.createMutationQuery(jakarta.persistence.criteria.CriteriaUpdate<?> updateQuery) Create an instance ofMutiny.MutationQueryfor the given update tree.createMutationQuery(String queryString) Create an instance ofMutiny.MutationQueryfor the given HQL/JPQL update or delete statement.createMutationQuery(JpaCriteriaInsert<?> insert) Create aMutiny.MutationQueryfrom the given insert select criteria tree<R> Mutiny.Query<R>createNamedQuery(String queryName) Create an instance ofMutiny.Queryfor the named query.<R> Mutiny.SelectionQuery<R>createNamedQuery(String queryName, Class<R> resultType) Create an instance ofMutiny.SelectionQueryfor the named query.<R> Mutiny.Query<R>createNativeQuery(String queryString) Create an instance ofMutiny.Queryfor 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.SelectionQueryfor the given SQL query string, using the givenresultTypeto interpret the results.<R> Mutiny.SelectionQuery<R>createNativeQuery(String queryString, Class<R> resultType, AffectedEntities affectedEntities) Create an instance ofMutiny.SelectionQueryfor the given SQL query string, using the givenresultTypeto interpret the results.<R> Mutiny.Query<R>createNativeQuery(String queryString, AffectedEntities affectedEntities) Create an instance ofMutiny.Queryfor 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.SelectionQueryfor the given SQL query string, using the givenResultSetMappingto interpret the result set.<R> Mutiny.SelectionQuery<R>createNativeQuery(String queryString, ResultSetMapping<R> resultSetMapping, AffectedEntities affectedEntities) Create an instance ofMutiny.SelectionQueryfor the given SQL query string, using the givenResultSetMappingto interpret the result set.createQuery(jakarta.persistence.criteria.CriteriaDelete<R> criteriaDelete) Create an instance ofMutiny.MutationQueryfor the given criteria delete.<R> Mutiny.SelectionQuery<R>createQuery(jakarta.persistence.criteria.CriteriaQuery<R> criteriaQuery) Create an instance ofMutiny.SelectionQueryfor the given criteria query.createQuery(jakarta.persistence.criteria.CriteriaUpdate<R> criteriaUpdate) Create an instance ofMutiny.MutationQueryfor the given criteria update.<R> Mutiny.Query<R>createQuery(jakarta.persistence.TypedQueryReference<R> typedQueryReference) Create a typedQueryinstance 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.SelectionQueryfor the given HQL/JPQL query string and query result type.<R> Mutiny.SelectionQuery<R>createSelectionQuery(String queryString, Class<R> resultType) Create an instance ofMutiny.SelectionQueryfor the given HQL/JPQL query string.Obtain the transaction currently associated with this session, if any.abstract Mutiny.StatelessSessiondelegate()io.smallrye.mutiny.Uni<Void>Delete a row.io.smallrye.mutiny.Uni<Void>Delete multiple rows.io.smallrye.mutiny.Uni<Void>Delete multiple rows, using the number of the given entities as the batch size.io.smallrye.mutiny.Uni<Void>deleteMultiple(List<?> entities) Delete multiple rows, using the size of the given list as the batch size.<T> io.smallrye.mutiny.Uni<T>fetch(T association) Asynchronously fetch an association that's configured for lazy loading.<T> io.smallrye.mutiny.Uni<T>Retrieve a row, using the givenEntityGraphas a fetch plan.<T> io.smallrye.mutiny.Uni<T>Retrieve a row.<T> io.smallrye.mutiny.Uni<List<T>>Retrieve multiple rows.<T> io.smallrye.mutiny.Uni<T>Retrieve a row, obtaining the specified lock mode.<T> io.smallrye.mutiny.Uni<T>Retrieve a row, obtaining the specified lock mode.jakarta.persistence.criteria.CriteriaBuilderConvenience method to obtain theCriteriaBuilder.<T> jakarta.persistence.EntityGraph<T>getEntityGraph(Class<T> rootType, String graphName) Obtain a namedEntityGraphTheMutiny.SessionFactorywhich created this session.getIdentifier(Object entity) Return the identifier value of the given entity, which may be detached.<T> ResultSetMapping<T>getResultSetMapping(Class<T> resultType, String mappingName) Obtain a native SQL result set mapping defined via the annotationSqlResultSetMapping.io.smallrye.mutiny.Uni<Void>Insert a row.io.smallrye.mutiny.Uni<Void>Insert multiple rows using the specified batch size.io.smallrye.mutiny.Uni<Void>Insert multiple rows, using the number of the given entities as the batch size.io.smallrye.mutiny.Uni<Void>insertMultiple(List<?> entities) Insert multiple rows, using the size of the given list as the batch size.booleanisOpen()io.smallrye.mutiny.Uni<Void>Refresh the entity instance state from the database.io.smallrye.mutiny.Uni<Void>Refresh the entity instance state from the database.io.smallrye.mutiny.Uni<Void>Refresh the entity instance state from the database.io.smallrye.mutiny.Uni<Void>refreshAll(int batchSize, Object... entities) Refresh the entity instance state from the database using the selected batch size.io.smallrye.mutiny.Uni<Void>refreshAll(Object... entities) Refresh the entity instance state from the database, using the number of the given entities as the batch size.io.smallrye.mutiny.Uni<Void>refreshMultiple(List<?> entities) Refresh the entity instance state from the database using the size of the given list as the batch size.io.smallrye.mutiny.Uni<Void>Update a row.io.smallrye.mutiny.Uni<Void>Update multiple rows.io.smallrye.mutiny.Uni<Void>Update multiple rows, using the number of the given entities as the batch size.io.smallrye.mutiny.Uni<Void>updateMultiple(List<?> entities) Update multiple rows, using the size of the given list as the batch size.io.smallrye.mutiny.Uni<Void>Use a SQLmerge intostatement to perform an upsert.io.smallrye.mutiny.Uni<Void>Use a SQLmerge intostatement to perform an upsert on multiple rows using the specified batch size.io.smallrye.mutiny.Uni<Void>Use a SQLmerge intostatement to perform an upsert on multiple rows using the size of the given array as batch size.io.smallrye.mutiny.Uni<Void>upsertMultiple(List<?> entities) Use a SQLmerge intostatement to perform an upsert on multiple rows using the size of the given list as batch size.<T> io.smallrye.mutiny.Uni<T>withTransaction(Function<Mutiny.Transaction, io.smallrye.mutiny.Uni<T>> work) Performs the given work within the scope of a database transaction, automatically flushing the session.
-
Constructor Details
-
MutinyStatelessSessionDelegator
public MutinyStatelessSessionDelegator()
-
-
Method Details
-
delegate
-
get
Description copied from interface:Mutiny.StatelessSessionRetrieve a row.- Specified by:
getin interfaceMutiny.StatelessSession- Parameters:
entityClass- The class of the entity to retrieveid- The id of the entity to retrieve- Returns:
- a detached entity instance, via a
Uni - See Also:
-
createQuery
Deprecated.Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.Queryfor the given HQL/JPQL query string or HQL/JPQL update or delete statement. In the case of an update or delete, the returnedMutiny.Querymust be executed usingMutiny.MutationQuery.executeUpdate()which returns an affected row count.- Specified by:
createQueryin interfaceMutiny.QueryProducer- Parameters:
queryString- The HQL/JPQL query, update or delete statement- Returns:
- The
Mutiny.Queryinstance for manipulation and execution - See Also:
-
EntityManager.createQuery(String)
-
get
Description copied from interface:Mutiny.StatelessSessionRetrieve a row, using the givenEntityGraphas a fetch plan.- Specified by:
getin interfaceMutiny.StatelessSession- Parameters:
entityGraph- anEntityGraphspecifying the entity and associations to be fetchedid- The id of the entity to retrieve- Returns:
- a detached entity instance, via a
Uni
-
get
Description copied from interface:Mutiny.StatelessSessionRetrieve multiple rows.- Specified by:
getin interfaceMutiny.StatelessSession- Parameters:
entityClass- The class of the entity to retrieveids- The ids of the entities to retrieve- Returns:
- a list of detached entity instances, via a
Uni - See Also:
-
createNativeQuery
public <R> Mutiny.SelectionQuery<R> createNativeQuery(String queryString, ResultSetMapping<R> resultSetMapping) Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.SelectionQueryfor the given SQL query string, using the givenResultSetMappingto interpret the result set.- Specified by:
createNativeQueryin interfaceMutiny.QueryProducer- Parameters:
queryString- The SQL queryresultSetMapping- the result set mapping- Returns:
- The
Mutiny.Queryinstance for manipulation and execution - See Also:
-
Mutiny.QueryProducer.getResultSetMapping(Class, String)EntityManager.createNativeQuery(String, String)
-
getIdentifier
Description copied from interface:Mutiny.StatelessSessionReturn the identifier value of the given entity, which may be detached.- Specified by:
getIdentifierin interfaceMutiny.StatelessSession- Parameters:
entity- a persistent instance associated with this session- Returns:
- the identifier
-
get
Description copied from interface:Mutiny.StatelessSessionRetrieve a row, obtaining the specified lock mode.- Specified by:
getin interfaceMutiny.StatelessSession- Parameters:
entityClass- The class of the entity to retrieveid- The id of the entity to retrievelockMode- The lock mode to apply to the entity- Returns:
- a detached entity instance, via a
Uni - See Also:
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceMutiny.StatelessSession- Returns:
- false if
Mutiny.StatelessSession.close()has been called
-
getCriteriaBuilder
public jakarta.persistence.criteria.CriteriaBuilder getCriteriaBuilder()Description copied from interface:Mutiny.QueryProducerConvenience method to obtain theCriteriaBuilder.- Specified by:
getCriteriaBuilderin interfaceMutiny.QueryProducer
-
insertAll
Description copied from interface:Mutiny.StatelessSessionInsert multiple rows, using the number of the given entities as the batch size.- Specified by:
insertAllin interfaceMutiny.StatelessSession- Parameters:
entities- new transient instances- See Also:
-
updateAll
Description copied from interface:Mutiny.StatelessSessionUpdate multiple rows.- Specified by:
updateAllin interfaceMutiny.StatelessSession- Parameters:
batchSize- the batch sizeentities- detached entity instances- See Also:
-
createEntityGraph
public <T> jakarta.persistence.EntityGraph<T> createEntityGraph(Class<T> rootType, String graphName) Description copied from interface:Mutiny.QueryProducerCreate a new mutable copy of a namedEntityGraph- Specified by:
createEntityGraphin interfaceMutiny.QueryProducer
-
getEntityGraph
Description copied from interface:Mutiny.QueryProducerObtain a namedEntityGraph- Specified by:
getEntityGraphin interfaceMutiny.QueryProducer
-
get
public <T> io.smallrye.mutiny.Uni<T> get(Class<T> entityClass, Object id, jakarta.persistence.LockModeType lockModeType) Description copied from interface:Mutiny.StatelessSessionRetrieve a row, obtaining the specified lock mode.- Specified by:
getin interfaceMutiny.StatelessSession- Parameters:
entityClass- The class of the entity to retrieveid- The id of the entity to retrievelockModeType- The lock mode to apply to the entity- Returns:
- a detached entity instance, via a
Uni - See Also:
-
update
Description copied from interface:Mutiny.StatelessSessionUpdate a row.- Specified by:
updatein interfaceMutiny.StatelessSession- Parameters:
entity- a detached entity instance- See Also:
-
refreshAll
Description copied from interface:Mutiny.StatelessSessionRefresh the entity instance state from the database using the selected batch size.- Specified by:
refreshAllin interfaceMutiny.StatelessSession- Parameters:
batchSize- the batch sizeentities- The entities to be refreshed.- See Also:
-
createQuery
public <R> Mutiny.Query<R> createQuery(jakarta.persistence.TypedQueryReference<R> typedQueryReference) Description copied from interface:Mutiny.QueryProducerCreate a typedQueryinstance for the given typed query reference.- Specified by:
createQueryin interfaceMutiny.QueryProducer- Parameters:
typedQueryReference- the type query reference- Returns:
- The
Queryinstance for execution - See Also:
-
createQuery
Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.SelectionQueryfor the given HQL/JPQL query string and query result type.- Specified by:
createQueryin interfaceMutiny.QueryProducer- Parameters:
queryString- The HQL/JPQL queryresultType- the Java type returned in each row of query results- Returns:
- The
Mutiny.SelectionQueryinstance for manipulation and execution - See Also:
-
EntityManager.createQuery(String, Class)
-
delete
Description copied from interface:Mutiny.StatelessSessionDelete a row.- Specified by:
deletein interfaceMutiny.StatelessSession- Parameters:
entity- a detached entity instance- See Also:
-
refresh
public io.smallrye.mutiny.Uni<Void> refresh(Object entity, jakarta.persistence.LockModeType lockModeType) Description copied from interface:Mutiny.StatelessSessionRefresh the entity instance state from the database.- Specified by:
refreshin interfaceMutiny.StatelessSession- Parameters:
entity- The entity to be refreshed.lockModeType- The LockMode to be applied.- See Also:
-
getFactory
Description copied from interface:Mutiny.StatelessSessionTheMutiny.SessionFactorywhich created this session.- Specified by:
getFactoryin interfaceMutiny.StatelessSession
-
createNativeQuery
Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.SelectionQueryfor the given SQL query string, using the givenresultTypeto interpret the results.- If the given result type is
Object, or a built-in type such asStringorInteger, 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.
- Specified by:
createNativeQueryin interfaceMutiny.QueryProducer- Parameters:
queryString- The SQL queryresultType- the Java type returned in each row of query results- Returns:
- The
Mutiny.SelectionQueryinstance for manipulation and execution - See Also:
-
EntityManager.createNativeQuery(String, Class)
- If the given result type is
-
deleteMultiple
Description copied from interface:Mutiny.StatelessSessionDelete multiple rows, using the size of the given list as the batch size.- Specified by:
deleteMultiplein interfaceMutiny.StatelessSession- Parameters:
entities- detached entity instances- See Also:
-
deleteAll
Description copied from interface:Mutiny.StatelessSessionDelete multiple rows, using the number of the given entities as the batch size.- Specified by:
deleteAllin interfaceMutiny.StatelessSession- Parameters:
entities- detached entity instances- See Also:
-
updateMultiple
Description copied from interface:Mutiny.StatelessSessionUpdate multiple rows, using the size of the given list as the batch size.- Specified by:
updateMultiplein interfaceMutiny.StatelessSession- Parameters:
entities- detached entity instances- See Also:
-
createSelectionQuery
Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.SelectionQueryfor the given HQL/JPQL query string.- Specified by:
createSelectionQueryin interfaceMutiny.QueryProducer- Parameters:
queryString- The HQL/JPQL query- Returns:
- The
Mutiny.SelectionQueryinstance for manipulation and execution - See Also:
-
EntityManager.createQuery(String, Class)
-
upsert
Description copied from interface:Mutiny.StatelessSessionUse a SQLmerge intostatement to perform an upsert.- Specified by:
upsertin interfaceMutiny.StatelessSession- Parameters:
entity- a detached entity instance- See Also:
-
createMutationQuery
Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.MutationQueryfor the given HQL/JPQL update or delete statement.- Specified by:
createMutationQueryin interfaceMutiny.QueryProducer- Parameters:
queryString- The HQL/JPQL query, update or delete statement- Returns:
- The
Mutiny.MutationQueryinstance for manipulation and execution - See Also:
-
EntityManager.createQuery(String)
-
refresh
Description copied from interface:Mutiny.StatelessSessionRefresh the entity instance state from the database.- Specified by:
refreshin interfaceMutiny.StatelessSession- Parameters:
entity- The entity to be refreshed.- See Also:
-
getResultSetMapping
Description copied from interface:Mutiny.QueryProducerObtain a native SQL result set mapping defined via the annotationSqlResultSetMapping.- Specified by:
getResultSetMappingin interfaceMutiny.QueryProducer
-
upsertMultiple
Description copied from interface:Mutiny.StatelessSessionUse a SQLmerge intostatement to perform an upsert on multiple rows using the size of the given list as batch size.- Specified by:
upsertMultiplein interfaceMutiny.StatelessSession- Parameters:
entities- the entities to upsert- See Also:
-
createQuery
public <R> Mutiny.MutationQuery createQuery(jakarta.persistence.criteria.CriteriaUpdate<R> criteriaUpdate) Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.MutationQueryfor the given criteria update.- Specified by:
createQueryin interfaceMutiny.QueryProducer- Parameters:
criteriaUpdate- TheCriteriaUpdate- Returns:
- The
Mutiny.MutationQueryinstance for manipulation and execution
-
insertAll
Description copied from interface:Mutiny.StatelessSessionInsert multiple rows using the specified batch size.- Specified by:
insertAllin interfaceMutiny.StatelessSession- Parameters:
batchSize- the batch sizeentities- new transient instances- See Also:
-
createNativeQuery
Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.Queryfor the given SQL query string, or SQL update, insert, or delete statement. In the case of an update, insert, or delete, the returnedMutiny.Querymust 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[].
- Specified by:
createNativeQueryin interfaceMutiny.QueryProducer- Parameters:
queryString- The SQL select, update, insert, or delete statement
-
createNamedQuery
Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.Queryfor the named query.- Specified by:
createNamedQueryin interfaceMutiny.QueryProducer- Parameters:
queryName- The name of the query- Returns:
- The
Mutiny.Queryinstance for manipulation and execution - See Also:
-
EntityManager.createQuery(String)
-
createNamedQuery
Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.SelectionQueryfor the named query.- Specified by:
createNamedQueryin interfaceMutiny.QueryProducer- Parameters:
queryName- The name of the queryresultType- the Java type returned in each row of query results- Returns:
- The
Mutiny.SelectionQueryinstance for manipulation and execution - See Also:
-
EntityManager.createQuery(String, Class)
-
refreshAll
Description copied from interface:Mutiny.StatelessSessionRefresh the entity instance state from the database, using the number of the given entities as the batch size.- Specified by:
refreshAllin interfaceMutiny.StatelessSession- Parameters:
entities- The entities to be refreshed.- See Also:
-
close
Description copied from interface:Mutiny.StatelessSessionClose the reactive session and release the underlying database connection.- Specified by:
closein interfaceMutiny.Closeable- Specified by:
closein interfaceMutiny.StatelessSession
-
updateAll
Description copied from interface:Mutiny.StatelessSessionUpdate multiple rows, using the number of the given entities as the batch size.- Specified by:
updateAllin interfaceMutiny.StatelessSession- Parameters:
entities- detached entity instances- See Also:
-
createQuery
public <R> Mutiny.SelectionQuery<R> createQuery(jakarta.persistence.criteria.CriteriaQuery<R> criteriaQuery) Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.SelectionQueryfor the given criteria query.- Specified by:
createQueryin interfaceMutiny.QueryProducer- Parameters:
criteriaQuery- TheCriteriaQuery- Returns:
- The
Mutiny.SelectionQueryinstance for manipulation and execution - See Also:
-
EntityManager.createQuery(String)
-
createQuery
public <R> Mutiny.MutationQuery createQuery(jakarta.persistence.criteria.CriteriaDelete<R> criteriaDelete) Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.MutationQueryfor the given criteria delete.- Specified by:
createQueryin interfaceMutiny.QueryProducer- Parameters:
criteriaDelete- TheCriteriaDelete- Returns:
- The
Mutiny.MutationQueryinstance for manipulation and execution
-
withTransaction
public <T> io.smallrye.mutiny.Uni<T> withTransaction(Function<Mutiny.Transaction, io.smallrye.mutiny.Uni<T>> work) Description copied from interface:Mutiny.StatelessSessionPerforms the given work within the scope of a database transaction, automatically flushing the session. The transaction will be rolled back if the work completes with an uncaught exception, or ifMutiny.Transaction.markForRollback()is called.- If there is already a transaction associated with this session, the work is executed in the context of the existing transaction, and no new transaction is initiated.
- If there is no transaction associated with this session, a new transaction is started, and the work is executed in the context of the new transaction.
- Specified by:
withTransactionin interfaceMutiny.StatelessSession- Parameters:
work- a function which acceptsMutiny.Transactionand returns the result of the work as aUni.- See Also:
-
refreshMultiple
Description copied from interface:Mutiny.StatelessSessionRefresh the entity instance state from the database using the size of the given list as the batch size.- Specified by:
refreshMultiplein interfaceMutiny.StatelessSession- Parameters:
entities- The entities to be refreshed.- See Also:
-
fetch
public <T> io.smallrye.mutiny.Uni<T> fetch(T association) Description copied from interface:Mutiny.StatelessSessionAsynchronously fetch an association that's configured for lazy loading.session.fetch(author.getBook()).thenAccept(book -> print(book.getTitle()))Warning: this operation in a stateless session is quite sensitive to data aliasing effects and should be used with great care.
- Specified by:
fetchin interfaceMutiny.StatelessSession- Parameters:
association- a lazy-loaded association- Returns:
- the fetched association, via a
Uni - See Also:
-
upsertAll
Description copied from interface:Mutiny.StatelessSessionUse a SQLmerge intostatement to perform an upsert on multiple rows using the size of the given array as batch size.- Specified by:
upsertAllin interfaceMutiny.StatelessSession- Parameters:
entities- the entities to upsert- See Also:
-
currentTransaction
Description copied from interface:Mutiny.StatelessSessionObtain the transaction currently associated with this session, if any.- Specified by:
currentTransactionin interfaceMutiny.StatelessSession- Returns:
- the
Mutiny.Transaction, or null if no transaction was started usingMutiny.StatelessSession.withTransaction(Function). - See Also:
-
upsertAll
Description copied from interface:Mutiny.StatelessSessionUse a SQLmerge intostatement to perform an upsert on multiple rows using the specified batch size.- Specified by:
upsertAllin interfaceMutiny.StatelessSession- Parameters:
batchSize- the batch sizeentities- the list of entities to upsert- See Also:
-
createEntityGraph
Description copied from interface:Mutiny.QueryProducerCreate a new mutableEntityGraph- Specified by:
createEntityGraphin interfaceMutiny.QueryProducer
-
insert
Description copied from interface:Mutiny.StatelessSessionInsert a row.- Specified by:
insertin interfaceMutiny.StatelessSession- Parameters:
entity- a new transient instance- See Also:
-
insertMultiple
Description copied from interface:Mutiny.StatelessSessionInsert multiple rows, using the size of the given list as the batch size.- Specified by:
insertMultiplein interfaceMutiny.StatelessSession- Parameters:
entities- new transient instances- See Also:
-
refresh
Description copied from interface:Mutiny.StatelessSessionRefresh the entity instance state from the database.- Specified by:
refreshin interfaceMutiny.StatelessSession- Parameters:
entity- The entity to be refreshed.lockMode- The LockMode to be applied.- See Also:
-
deleteAll
Description copied from interface:Mutiny.StatelessSessionDelete multiple rows.- Specified by:
deleteAllin interfaceMutiny.StatelessSession- Parameters:
batchSize- the batch sizeentities- detached entity instances- See Also:
-
createMutationQuery
public Mutiny.MutationQuery createMutationQuery(jakarta.persistence.criteria.CriteriaUpdate<?> updateQuery) Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.MutationQueryfor the given update tree.- Specified by:
createMutationQueryin interfaceMutiny.QueryProducer- Parameters:
updateQuery- the update criteria query- Returns:
- The
Mutiny.MutationQueryinstance for manipulation and execution - See Also:
-
createMutationQuery
public Mutiny.MutationQuery createMutationQuery(jakarta.persistence.criteria.CriteriaDelete<?> deleteQuery) Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.MutationQueryfor the given delete tree.- Specified by:
createMutationQueryin interfaceMutiny.QueryProducer- Parameters:
deleteQuery- the delete criteria query- Returns:
- The
Mutiny.MutationQueryinstance for manipulation and execution - See Also:
-
createMutationQuery
Description copied from interface:Mutiny.QueryProducerCreate aMutiny.MutationQueryfrom the given insert select criteria tree- Specified by:
createMutationQueryin interfaceMutiny.QueryProducer- Parameters:
insert- the insert select criteria query- Returns:
- The
Mutiny.MutationQueryinstance for manipulation and execution - See Also:
-
createNativeQuery
Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.Queryfor the given SQL query string, or SQL update, insert, or delete statement. In the case of an update, insert, or delete, the returnedMutiny.Querymust 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 entitiesare synchronized with the database before execution of the statement.- Specified by:
createNativeQueryin interfaceMutiny.QueryProducer- Parameters:
queryString- The SQL select, update, insert, or delete statementaffectedEntities- The entities which are affected by the statement
-
createNativeQuery
public <R> Mutiny.SelectionQuery<R> createNativeQuery(String queryString, Class<R> resultType, AffectedEntities affectedEntities) Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.SelectionQueryfor the given SQL query string, using the givenresultTypeto interpret the results.- If the given result type is
Object, or a built-in type such asStringorInteger, 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 entitiesare synchronized with the database before execution of the query.- Specified by:
createNativeQueryin interfaceMutiny.QueryProducer- 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.Queryinstance for manipulation and execution - See Also:
-
EntityManager.createNativeQuery(String, Class)
- If the given result type is
-
createNativeQuery
public <R> Mutiny.SelectionQuery<R> createNativeQuery(String queryString, ResultSetMapping<R> resultSetMapping, AffectedEntities affectedEntities) Description copied from interface:Mutiny.QueryProducerCreate an instance ofMutiny.SelectionQueryfor the given SQL query string, using the givenResultSetMappingto interpret the result set.Any
affected entitiesare synchronized with the database before execution of the query.- Specified by:
createNativeQueryin interfaceMutiny.QueryProducer- Parameters:
queryString- The SQL queryresultSetMapping- the result set mappingaffectedEntities- The entities which are affected by the query- Returns:
- The
Mutiny.SelectionQueryinstance for manipulation and execution - See Also:
-
Mutiny.QueryProducer.getResultSetMapping(Class, String)EntityManager.createNativeQuery(String, String)
-