Interface ModificationCriteriaBuilder<X extends ModificationCriteriaBuilder<X>>

Type Parameters:
X - The concrete builder type
All Superinterfaces:
BaseModificationCriteriaBuilder<X>, BaseWhereBuilder<X>, CommonQueryBuilder<X>, ConfigurationSource, CTEBuilder<X>, Executable, FromBaseBuilder<X>, FromBuilder<X>, FromProvider, ParameterHolder<X>, ServiceProvider, WhereBuilder<X>
All Known Subinterfaces:
DeleteCriteriaBuilder<T>, InsertCriteriaBuilder<T>, UpdateCriteriaBuilder<T>

public interface ModificationCriteriaBuilder<X extends ModificationCriteriaBuilder<X>>
extends Executable, CommonQueryBuilder<X>, BaseModificationCriteriaBuilder<X>, CTEBuilder<X>
A builder for modification queries.
Since:
1.1.0
Author:
Christian Beikov
  • Method Details

    • getRoot

      From getRoot()
      Returns the query root.
      Returns:
      The root of this query
      Since:
      1.2.0
    • executeWithReturning

      ReturningResult<javax.persistence.Tuple> executeWithReturning​(String... attributes)
      Executes the modification query and returns the given attributes as tuples.
      Parameters:
      attributes - The attributes of a changed entity to return
      Returns:
      A result wrapper containing the update count and the new values of the attributes
    • executeWithReturning

      <T> ReturningResult<T> executeWithReturning​(String attribute, Class<T> type)
      Executes the modification query and returns the given attribute with the specified type.
      Type Parameters:
      T - The result type of the attribute
      Parameters:
      attribute - The attribute of a changed entity to return
      type - The type of the attribute
      Returns:
      A result wrapper containing the update count and the new value of the attribute
    • executeWithReturning

      <T> ReturningResult<T> executeWithReturning​(ReturningObjectBuilder<T> objectBuilder)
      Executes the modification query and returns an object consisting of the attributes applied by the object builder.
      Type Parameters:
      T - The type of the object constructed by the object builder
      Parameters:
      objectBuilder - The object builder that applies attributes and constructs the result objects
      Returns:
      A result wrapper containing the update count and the objects constructed by the obbject builder
    • getWithReturningQuery

      javax.persistence.TypedQuery<ReturningResult<javax.persistence.Tuple>> getWithReturningQuery​(String... attributes)
      Creates a query that contains the modification query and returns the given attributes as tuples.
      Parameters:
      attributes - The attributes of a changed entity to return
      Returns:
      A result wrapper containing the update count and the new values of the attributes
    • getWithReturningQuery

      <T> javax.persistence.TypedQuery<ReturningResult<T>> getWithReturningQuery​(String attribute, Class<T> type)
      Creates a query that contains the modification query and returns the given attribute with the specified type.
      Type Parameters:
      T - The result type of the attribute
      Parameters:
      attribute - The attribute of a changed entity to return
      type - The type of the attribute
      Returns:
      A result wrapper containing the update count and the new value of the attribute
    • getWithReturningQuery

      <T> javax.persistence.TypedQuery<ReturningResult<T>> getWithReturningQuery​(ReturningObjectBuilder<T> objectBuilder)
      Creates a query that contains the modification query and returns an object consisting of the attributes applied by the object builder.
      Type Parameters:
      T - The type of the object constructed by the object builder
      Parameters:
      objectBuilder - The object builder that applies attributes and constructs the result objects
      Returns:
      A result wrapper containing the update count and the objects constructed by the obbject builder