Interface CriteriaBuilder<T>

Type Parameters:
T - The query result type
All Superinterfaces:
BaseCriteriaBuilder<T,​CriteriaBuilder<T>>, BaseHavingBuilder<CriteriaBuilder<T>>, BaseQueryBuilder<T,​CriteriaBuilder<T>>, BaseWhereBuilder<CriteriaBuilder<T>>, CommonQueryBuilder<CriteriaBuilder<T>>, ConfigurationSource, CorrelationQueryBuilder<CriteriaBuilder<T>>, CTEBuilder<CriteriaBuilder<T>>, DistinctBuilder<CriteriaBuilder<T>>, FetchBuilder<CriteriaBuilder<T>>, FromBaseBuilder<CriteriaBuilder<T>>, FromBuilder<CriteriaBuilder<T>>, FromProvider, FullQueryBuilder<T,​CriteriaBuilder<T>>, GroupByBuilder<CriteriaBuilder<T>>, HavingBuilder<CriteriaBuilder<T>>, KeysetQueryBuilder<CriteriaBuilder<T>>, LimitBuilder<CriteriaBuilder<T>>, OrderByBuilder<CriteriaBuilder<T>>, ParameterHolder<CriteriaBuilder<T>>, Queryable<T,​CriteriaBuilder<T>>, QueryBuilder<T,​CriteriaBuilder<T>>, SelectBuilder<CriteriaBuilder<T>>, ServiceProvider, SetOperationBuilder<LeafOngoingSetOperationCriteriaBuilder<T>,​StartOngoingSetOperationCriteriaBuilder<T,​LeafOngoingFinalSetOperationCriteriaBuilder<T>>>, WhereBuilder<CriteriaBuilder<T>>, WindowContainerBuilder<CriteriaBuilder<T>>

public interface CriteriaBuilder<T>
extends FullQueryBuilder<T,​CriteriaBuilder<T>>, BaseCriteriaBuilder<T,​CriteriaBuilder<T>>, CTEBuilder<CriteriaBuilder<T>>, SetOperationBuilder<LeafOngoingSetOperationCriteriaBuilder<T>,​StartOngoingSetOperationCriteriaBuilder<T,​LeafOngoingFinalSetOperationCriteriaBuilder<T>>>
A builder for criteria queries. This is the entry point for building queries.
Since:
1.0.0
Author:
Christian Beikov
  • Method Details

    • getQueryRootCountQuery

      javax.persistence.TypedQuery<Long> getQueryRootCountQuery()
      Returns a query that counts the distinct query root results that would be produced if the current query was run.
      Returns:
      A query for determining the count of the distinct query root result list represented by this query builder
      Since:
      1.3.0
    • getQueryRootCountQueryString

      String getQueryRootCountQueryString()
      Returns the query string that selects the distinct count of query root elements.
      Returns:
      The query string
      Since:
      1.3.0
    • getQueryRootCountQuery

      javax.persistence.TypedQuery<Long> getQueryRootCountQuery​(long maximumCount)
      Returns a query that counts the distinct query root results and counts up to the maximum value that is given that would be produced if the current query was run.
      Parameters:
      maximumCount - the maximum value up to which should be counted
      Returns:
      A query for determining the count of the distinct query root result list represented by this query builder
      Since:
      1.5.0
    • getQueryRootCountQueryString

      String getQueryRootCountQueryString​(long maximumCount)
      Returns the query string that selects the distinct count of query root elements and counts up to the maximum value that is given.
      Parameters:
      maximumCount - the maximum value up to which should be counted
      Returns:
      The query string
      Since:
      1.5.0
    • copy

      <Y> CriteriaBuilder<Y> copy​(Class<Y> resultClass)
      Description copied from interface: FullQueryBuilder
      Copies this query builder into a new one, using it's projection as an overridable default.
      Specified by:
      copy in interface FullQueryBuilder<T,​CriteriaBuilder<T>>
      Type Parameters:
      Y - The type of the result class
      Parameters:
      resultClass - The result class of the query
      Returns:
      A new query builder
    • selectNew

      <Y> SelectObjectBuilder<CriteriaBuilder<Y>> selectNew​(Class<Y> clazz)
      Description copied from interface: FullQueryBuilder
      Starts a SelectObjectBuilder for the given class. The types of the parameter arguments used in the SelectObjectBuilder must match a constructor of the given class.
      Specified by:
      selectNew in interface FullQueryBuilder<T,​CriteriaBuilder<T>>
      Type Parameters:
      Y - The new query result type specified by the given class
      Parameters:
      clazz - The class which should be used for the select new select clause
      Returns:
      The select object builder for the given class
    • selectNew

      <Y> CriteriaBuilder<Y> selectNew​(ObjectBuilder<Y> builder)
      Description copied from interface: FullQueryBuilder
      Applies the given object builder to this query. The object builder provides the select clauses and is used to transform the result set tuples.
      Specified by:
      selectNew in interface FullQueryBuilder<T,​CriteriaBuilder<T>>
      Type Parameters:
      Y - The new query result type specified by the given class
      Parameters:
      builder - The object builder which transforms the result set into objects of type Y
      Returns:
      The query builder for chaining calls