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 Details

    • MutinyStatelessSessionDelegator

      public MutinyStatelessSessionDelegator()
  • Method Details

    • delegate

      public abstract Mutiny.StatelessSession delegate()
    • get

      public <T> io.smallrye.mutiny.Uni<T> get(Class<T> entityClass, Object id)
      Description copied from interface: Mutiny.StatelessSession
      Retrieve a row.
      Specified by:
      get in interface Mutiny.StatelessSession
      Parameters:
      entityClass - The class of the entity to retrieve
      id - The id of the entity to retrieve
      Returns:
      a detached entity instance, via a Uni
      See Also:
      • StatelessSession.get(Class, Object)
    • createQuery

      @Deprecated public <R> Mutiny.Query<R> createQuery(String queryString)
      Deprecated.
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.Query for the given HQL/JPQL query string or HQL/JPQL update or delete statement. In the case of an update or delete, the returned Mutiny.Query must be executed using Mutiny.MutationQuery.executeUpdate() which returns an affected row count.
      Specified by:
      createQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The HQL/JPQL query, update or delete statement
      Returns:
      The Mutiny.Query instance for manipulation and execution
      See Also:
      • EntityManager.createQuery(String)
    • get

      public <T> io.smallrye.mutiny.Uni<T> get(jakarta.persistence.EntityGraph<T> entityGraph, Object id)
      Description copied from interface: Mutiny.StatelessSession
      Retrieve a row, using the given EntityGraph as a fetch plan.
      Specified by:
      get in interface Mutiny.StatelessSession
      Parameters:
      entityGraph - an EntityGraph specifying the entity and associations to be fetched
      id - The id of the entity to retrieve
      Returns:
      a detached entity instance, via a Uni
    • get

      public <T> io.smallrye.mutiny.Uni<List<T>> get(Class<T> entityClass, Object... ids)
      Description copied from interface: Mutiny.StatelessSession
      Retrieve multiple rows.
      Specified by:
      get in interface Mutiny.StatelessSession
      Parameters:
      entityClass - The class of the entity to retrieve
      ids - The ids of the entities to retrieve
      Returns:
      a list of detached entity instances, via a Uni
      See Also:
      • StatelessSession.getMultiple(Class, List)
    • createNativeQuery

      public <R> Mutiny.SelectionQuery<R> createNativeQuery(String queryString, ResultSetMapping<R> resultSetMapping)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.SelectionQuery for the given SQL query string, using the given ResultSetMapping to interpret the result set.
      Specified by:
      createNativeQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The SQL query
      resultSetMapping - the result set mapping
      Returns:
      The Mutiny.Query instance for manipulation and execution
      See Also:
    • getIdentifier

      public Object getIdentifier(Object entity)
      Description copied from interface: Mutiny.StatelessSession
      Return the identifier value of the given entity, which may be detached.
      Specified by:
      getIdentifier in interface Mutiny.StatelessSession
      Parameters:
      entity - a persistent instance associated with this session
      Returns:
      the identifier
    • get

      public <T> io.smallrye.mutiny.Uni<T> get(Class<T> entityClass, Object id, org.hibernate.LockMode lockMode)
      Description copied from interface: Mutiny.StatelessSession
      Retrieve a row, obtaining the specified lock mode.
      Specified by:
      get in interface Mutiny.StatelessSession
      Parameters:
      entityClass - The class of the entity to retrieve
      id - The id of the entity to retrieve
      lockMode - The lock mode to apply to the entity
      Returns:
      a detached entity instance, via a Uni
      See Also:
      • StatelessSession.get(Class, Object, LockMode)
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface Mutiny.StatelessSession
      Returns:
      false if Mutiny.StatelessSession.close() has been called
    • getCriteriaBuilder

      public jakarta.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
      Description copied from interface: Mutiny.QueryProducer
      Convenience method to obtain the CriteriaBuilder.
      Specified by:
      getCriteriaBuilder in interface Mutiny.QueryProducer
    • insertAll

      public io.smallrye.mutiny.Uni<Void> insertAll(Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Insert multiple rows, using the number of the given entities as the batch size.
      Specified by:
      insertAll in interface Mutiny.StatelessSession
      Parameters:
      entities - new transient instances
      See Also:
      • StatelessSession.insert(Object)
    • updateAll

      public io.smallrye.mutiny.Uni<Void> updateAll(int batchSize, Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Update multiple rows.
      Specified by:
      updateAll in interface Mutiny.StatelessSession
      Parameters:
      batchSize - the batch size
      entities - detached entity instances
      See Also:
      • StatelessSession.update(Object)
    • createEntityGraph

      public <T> jakarta.persistence.EntityGraph<T> createEntityGraph(Class<T> rootType, String graphName)
      Description copied from interface: Mutiny.QueryProducer
      Create a new mutable copy of a named EntityGraph
      Specified by:
      createEntityGraph in interface Mutiny.QueryProducer
    • getEntityGraph

      public <T> jakarta.persistence.EntityGraph<T> getEntityGraph(Class<T> rootType, String graphName)
      Description copied from interface: Mutiny.QueryProducer
      Obtain a named EntityGraph
      Specified by:
      getEntityGraph in interface Mutiny.QueryProducer
    • get

      public <T> io.smallrye.mutiny.Uni<T> get(Class<T> entityClass, Object id, jakarta.persistence.LockModeType lockModeType)
      Description copied from interface: Mutiny.StatelessSession
      Retrieve a row, obtaining the specified lock mode.
      Specified by:
      get in interface Mutiny.StatelessSession
      Parameters:
      entityClass - The class of the entity to retrieve
      id - The id of the entity to retrieve
      lockModeType - The lock mode to apply to the entity
      Returns:
      a detached entity instance, via a Uni
      See Also:
      • StatelessSession.get(Class, Object, LockMode)
    • update

      public io.smallrye.mutiny.Uni<Void> update(Object entity)
      Description copied from interface: Mutiny.StatelessSession
      Update a row.
      Specified by:
      update in interface Mutiny.StatelessSession
      Parameters:
      entity - a detached entity instance
      See Also:
      • StatelessSession.update(Object)
    • refreshAll

      public io.smallrye.mutiny.Uni<Void> refreshAll(int batchSize, Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Refresh the entity instance state from the database using the selected batch size.
      Specified by:
      refreshAll in interface Mutiny.StatelessSession
      Parameters:
      batchSize - the batch size
      entities - The entities to be refreshed.
      See Also:
      • StatelessSession.refresh(Object)
    • createQuery

      public <R> Mutiny.Query<R> createQuery(jakarta.persistence.TypedQueryReference<R> typedQueryReference)
      Description copied from interface: Mutiny.QueryProducer
      Create a typed Query instance for the given typed query reference.
      Specified by:
      createQuery in interface Mutiny.QueryProducer
      Parameters:
      typedQueryReference - the type query reference
      Returns:
      The Query instance for execution
      See Also:
      • QueryProducer.createQuery(TypedQueryReference)
    • createQuery

      public <R> Mutiny.SelectionQuery<R> createQuery(String queryString, Class<R> resultType)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.SelectionQuery for the given HQL/JPQL query string and query result type.
      Specified by:
      createQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The HQL/JPQL query
      resultType - 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)
    • delete

      public io.smallrye.mutiny.Uni<Void> delete(Object entity)
      Description copied from interface: Mutiny.StatelessSession
      Delete a row.
      Specified by:
      delete in interface Mutiny.StatelessSession
      Parameters:
      entity - a detached entity instance
      See Also:
      • StatelessSession.delete(Object)
    • refresh

      public io.smallrye.mutiny.Uni<Void> refresh(Object entity, jakarta.persistence.LockModeType lockModeType)
      Description copied from interface: Mutiny.StatelessSession
      Refresh the entity instance state from the database.
      Specified by:
      refresh in interface Mutiny.StatelessSession
      Parameters:
      entity - The entity to be refreshed.
      lockModeType - The LockMode to be applied.
      See Also:
      • StatelessSession.refresh(Object, LockMode)
    • getFactory

      public Mutiny.SessionFactory getFactory()
      Description copied from interface: Mutiny.StatelessSession
      The Mutiny.SessionFactory which created this session.
      Specified by:
      getFactory in interface Mutiny.StatelessSession
    • createNativeQuery

      public <R> Mutiny.SelectionQuery<R> createNativeQuery(String queryString, Class<R> resultType)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.SelectionQuery for the given SQL query string, using the given resultType to interpret the results.
      • If the given result type is Object, or a built-in type such as String or Integer, 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:
      createNativeQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The SQL query
      resultType - 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)
    • deleteMultiple

      public io.smallrye.mutiny.Uni<Void> deleteMultiple(List<?> entities)
      Description copied from interface: Mutiny.StatelessSession
      Delete multiple rows, using the size of the given list as the batch size.
      Specified by:
      deleteMultiple in interface Mutiny.StatelessSession
      Parameters:
      entities - detached entity instances
      See Also:
      • StatelessSession.delete(Object)
    • deleteAll

      public io.smallrye.mutiny.Uni<Void> deleteAll(Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Delete multiple rows, using the number of the given entities as the batch size.
      Specified by:
      deleteAll in interface Mutiny.StatelessSession
      Parameters:
      entities - detached entity instances
      See Also:
      • StatelessSession.delete(Object)
    • updateMultiple

      public io.smallrye.mutiny.Uni<Void> updateMultiple(List<?> entities)
      Description copied from interface: Mutiny.StatelessSession
      Update multiple rows, using the size of the given list as the batch size.
      Specified by:
      updateMultiple in interface Mutiny.StatelessSession
      Parameters:
      entities - detached entity instances
      See Also:
      • StatelessSession.update(Object)
    • createSelectionQuery

      public <R> Mutiny.SelectionQuery<R> createSelectionQuery(String queryString, Class<R> resultType)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.SelectionQuery for the given HQL/JPQL query string.
      Specified by:
      createSelectionQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The HQL/JPQL query
      Returns:
      The Mutiny.SelectionQuery instance for manipulation and execution
      See Also:
      • EntityManager.createQuery(String, Class)
    • upsert

      @Incubating public io.smallrye.mutiny.Uni<Void> upsert(Object entity)
      Description copied from interface: Mutiny.StatelessSession
      Use a SQL merge into statement to perform an upsert.
      Specified by:
      upsert in interface Mutiny.StatelessSession
      Parameters:
      entity - a detached entity instance
      See Also:
      • StatelessSession.upsert(Object)
    • createMutationQuery

      public Mutiny.MutationQuery createMutationQuery(String queryString)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.MutationQuery for the given HQL/JPQL update or delete statement.
      Specified by:
      createMutationQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The HQL/JPQL query, update or delete statement
      Returns:
      The Mutiny.MutationQuery instance for manipulation and execution
      See Also:
      • EntityManager.createQuery(String)
    • refresh

      public io.smallrye.mutiny.Uni<Void> refresh(Object entity)
      Description copied from interface: Mutiny.StatelessSession
      Refresh the entity instance state from the database.
      Specified by:
      refresh in interface Mutiny.StatelessSession
      Parameters:
      entity - The entity to be refreshed.
      See Also:
      • StatelessSession.refresh(Object)
    • getResultSetMapping

      public <T> ResultSetMapping<T> getResultSetMapping(Class<T> resultType, String mappingName)
      Description copied from interface: Mutiny.QueryProducer
      Obtain a native SQL result set mapping defined via the annotation SqlResultSetMapping.
      Specified by:
      getResultSetMapping in interface Mutiny.QueryProducer
    • upsertMultiple

      @Incubating public io.smallrye.mutiny.Uni<Void> upsertMultiple(List<?> entities)
      Description copied from interface: Mutiny.StatelessSession
      Use a SQL merge into statement to perform an upsert on multiple rows using the size of the given list as batch size.
      Specified by:
      upsertMultiple in interface Mutiny.StatelessSession
      Parameters:
      entities - the entities to upsert
      See Also:
      • StatelessSession.upsert(Object)
    • createQuery

      public <R> Mutiny.MutationQuery createQuery(jakarta.persistence.criteria.CriteriaUpdate<R> criteriaUpdate)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.MutationQuery for the given criteria update.
      Specified by:
      createQuery in interface Mutiny.QueryProducer
      Parameters:
      criteriaUpdate - The CriteriaUpdate
      Returns:
      The Mutiny.MutationQuery instance for manipulation and execution
    • insertAll

      public io.smallrye.mutiny.Uni<Void> insertAll(int batchSize, Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Insert multiple rows using the specified batch size.
      Specified by:
      insertAll in interface Mutiny.StatelessSession
      Parameters:
      batchSize - the batch size
      entities - new transient instances
      See Also:
      • StatelessSession.insert(Object)
    • createNativeQuery

      public <R> Mutiny.Query<R> createNativeQuery(String queryString)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.Query for the given SQL query string, or SQL update, insert, or delete statement. In the case of an update, insert, or delete, the returned Mutiny.Query must be executed using Mutiny.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:
      createNativeQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The SQL select, update, insert, or delete statement
    • createNamedQuery

      public <R> Mutiny.Query<R> createNamedQuery(String queryName)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.Query for the named query.
      Specified by:
      createNamedQuery in interface Mutiny.QueryProducer
      Parameters:
      queryName - The name of the query
      Returns:
      The Mutiny.Query instance for manipulation and execution
      See Also:
      • EntityManager.createQuery(String)
    • createNamedQuery

      public <R> Mutiny.SelectionQuery<R> createNamedQuery(String queryName, Class<R> resultType)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.SelectionQuery for the named query.
      Specified by:
      createNamedQuery in interface Mutiny.QueryProducer
      Parameters:
      queryName - The name of the query
      resultType - 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)
    • refreshAll

      public io.smallrye.mutiny.Uni<Void> refreshAll(Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Refresh the entity instance state from the database, using the number of the given entities as the batch size.
      Specified by:
      refreshAll in interface Mutiny.StatelessSession
      Parameters:
      entities - The entities to be refreshed.
      See Also:
      • StatelessSession.refresh(Object)
    • close

      public io.smallrye.mutiny.Uni<Void> close()
      Description copied from interface: Mutiny.StatelessSession
      Close the reactive session and release the underlying database connection.
      Specified by:
      close in interface Mutiny.Closeable
      Specified by:
      close in interface Mutiny.StatelessSession
    • updateAll

      public io.smallrye.mutiny.Uni<Void> updateAll(Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Update multiple rows, using the number of the given entities as the batch size.
      Specified by:
      updateAll in interface Mutiny.StatelessSession
      Parameters:
      entities - detached entity instances
      See Also:
      • StatelessSession.update(Object)
    • createQuery

      public <R> Mutiny.SelectionQuery<R> createQuery(jakarta.persistence.criteria.CriteriaQuery<R> criteriaQuery)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.SelectionQuery for the given criteria query.
      Specified by:
      createQuery in interface Mutiny.QueryProducer
      Parameters:
      criteriaQuery - The CriteriaQuery
      Returns:
      The Mutiny.SelectionQuery instance 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.QueryProducer
      Create an instance of Mutiny.MutationQuery for the given criteria delete.
      Specified by:
      createQuery in interface Mutiny.QueryProducer
      Parameters:
      criteriaDelete - The CriteriaDelete
      Returns:
      The Mutiny.MutationQuery instance 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.StatelessSession
      Performs 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 if Mutiny.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:
      withTransaction in interface Mutiny.StatelessSession
      Parameters:
      work - a function which accepts Mutiny.Transaction and returns the result of the work as a Uni.
      See Also:
    • refreshMultiple

      public io.smallrye.mutiny.Uni<Void> refreshMultiple(List<?> entities)
      Description copied from interface: Mutiny.StatelessSession
      Refresh the entity instance state from the database using the size of the given list as the batch size.
      Specified by:
      refreshMultiple in interface Mutiny.StatelessSession
      Parameters:
      entities - The entities to be refreshed.
      See Also:
      • StatelessSession.refresh(Object)
    • fetch

      public <T> io.smallrye.mutiny.Uni<T> fetch(T association)
      Description copied from interface: Mutiny.StatelessSession
      Asynchronously 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:
      fetch in interface Mutiny.StatelessSession
      Parameters:
      association - a lazy-loaded association
      Returns:
      the fetched association, via a Uni
      See Also:
      • Hibernate.initialize(Object)
    • upsertAll

      @Incubating public io.smallrye.mutiny.Uni<Void> upsertAll(Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Use a SQL merge into statement to perform an upsert on multiple rows using the size of the given array as batch size.
      Specified by:
      upsertAll in interface Mutiny.StatelessSession
      Parameters:
      entities - the entities to upsert
      See Also:
      • StatelessSession.upsert(Object)
    • currentTransaction

      public Mutiny.Transaction currentTransaction()
      Description copied from interface: Mutiny.StatelessSession
      Obtain the transaction currently associated with this session, if any.
      Specified by:
      currentTransaction in interface Mutiny.StatelessSession
      Returns:
      the Mutiny.Transaction, or null if no transaction was started using Mutiny.StatelessSession.withTransaction(Function).
      See Also:
    • upsertAll

      @Incubating public io.smallrye.mutiny.Uni<Void> upsertAll(int batchSize, Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Use a SQL merge into statement to perform an upsert on multiple rows using the specified batch size.
      Specified by:
      upsertAll in interface Mutiny.StatelessSession
      Parameters:
      batchSize - the batch size
      entities - the list of entities to upsert
      See Also:
      • StatelessSession.upsert(Object)
    • createEntityGraph

      public <T> jakarta.persistence.EntityGraph<T> createEntityGraph(Class<T> rootType)
      Description copied from interface: Mutiny.QueryProducer
      Create a new mutable EntityGraph
      Specified by:
      createEntityGraph in interface Mutiny.QueryProducer
    • insert

      public io.smallrye.mutiny.Uni<Void> insert(Object entity)
      Description copied from interface: Mutiny.StatelessSession
      Insert a row.
      Specified by:
      insert in interface Mutiny.StatelessSession
      Parameters:
      entity - a new transient instance
      See Also:
      • StatelessSession.insert(Object)
    • insertMultiple

      public io.smallrye.mutiny.Uni<Void> insertMultiple(List<?> entities)
      Description copied from interface: Mutiny.StatelessSession
      Insert multiple rows, using the size of the given list as the batch size.
      Specified by:
      insertMultiple in interface Mutiny.StatelessSession
      Parameters:
      entities - new transient instances
      See Also:
      • StatelessSession.insert(Object)
    • refresh

      public io.smallrye.mutiny.Uni<Void> refresh(Object entity, org.hibernate.LockMode lockMode)
      Description copied from interface: Mutiny.StatelessSession
      Refresh the entity instance state from the database.
      Specified by:
      refresh in interface Mutiny.StatelessSession
      Parameters:
      entity - The entity to be refreshed.
      lockMode - The LockMode to be applied.
      See Also:
      • StatelessSession.refresh(Object, LockMode)
    • deleteAll

      public io.smallrye.mutiny.Uni<Void> deleteAll(int batchSize, Object... entities)
      Description copied from interface: Mutiny.StatelessSession
      Delete multiple rows.
      Specified by:
      deleteAll in interface Mutiny.StatelessSession
      Parameters:
      batchSize - the batch size
      entities - detached entity instances
      See Also:
      • StatelessSession.delete(Object)
    • createMutationQuery

      public Mutiny.MutationQuery createMutationQuery(jakarta.persistence.criteria.CriteriaUpdate<?> updateQuery)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.MutationQuery for the given update tree.
      Specified by:
      createMutationQuery in interface Mutiny.QueryProducer
      Parameters:
      updateQuery - the update criteria query
      Returns:
      The Mutiny.MutationQuery instance for manipulation and execution
      See Also:
      • QueryProducer.createMutationQuery(CriteriaUpdate)
    • createMutationQuery

      public Mutiny.MutationQuery createMutationQuery(jakarta.persistence.criteria.CriteriaDelete<?> deleteQuery)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.MutationQuery for the given delete tree.
      Specified by:
      createMutationQuery in interface Mutiny.QueryProducer
      Parameters:
      deleteQuery - the delete criteria query
      Returns:
      The Mutiny.MutationQuery instance for manipulation and execution
      See Also:
      • QueryProducer.createMutationQuery(CriteriaDelete)
    • createMutationQuery

      public Mutiny.MutationQuery createMutationQuery(org.hibernate.query.criteria.JpaCriteriaInsert<?> insert)
      Description copied from interface: Mutiny.QueryProducer
      Create a Mutiny.MutationQuery from the given insert select criteria tree
      Specified by:
      createMutationQuery in interface Mutiny.QueryProducer
      Parameters:
      insert - the insert select criteria query
      Returns:
      The Mutiny.MutationQuery instance for manipulation and execution
      See Also:
      • QueryProducer.createMutationQuery(JpaCriteriaInsert)
    • createNativeQuery

      public <R> Mutiny.Query<R> createNativeQuery(String queryString, AffectedEntities affectedEntities)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.Query for the given SQL query string, or SQL update, insert, or delete statement. In the case of an update, insert, or delete, the returned Mutiny.Query must be executed using Mutiny.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.

      Specified by:
      createNativeQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The SQL select, update, insert, or delete statement
      affectedEntities - 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.QueryProducer
      Create an instance of Mutiny.SelectionQuery for the given SQL query string, using the given resultType to interpret the results.
      • If the given result type is Object, or a built-in type such as String or Integer, 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.

      Specified by:
      createNativeQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The SQL query
      resultType - the Java type returned in each row of query results
      affectedEntities - The entities which are affected by the query
      Returns:
      The Mutiny.Query instance for manipulation and execution
      See Also:
      • EntityManager.createNativeQuery(String, Class)
    • createNativeQuery

      public <R> Mutiny.SelectionQuery<R> createNativeQuery(String queryString, ResultSetMapping<R> resultSetMapping, AffectedEntities affectedEntities)
      Description copied from interface: Mutiny.QueryProducer
      Create an instance of Mutiny.SelectionQuery for the given SQL query string, using the given ResultSetMapping to interpret the result set.

      Any affected entities are synchronized with the database before execution of the query.

      Specified by:
      createNativeQuery in interface Mutiny.QueryProducer
      Parameters:
      queryString - The SQL query
      resultSetMapping - the result set mapping
      affectedEntities - The entities which are affected by the query
      Returns:
      The Mutiny.SelectionQuery instance for manipulation and execution
      See Also: