Interface JpaSelectCriteria<T>

All Superinterfaces:
AbstractQuery<T>, CommonAbstractCriteria, JpaCriteriaBase, JpaCriteriaNode, Serializable
All Known Subinterfaces:
JpaCriteriaQuery<T>, JpaSubQuery<T>, SqmSelectQuery<T>
All Known Implementing Classes:
AbstractSqmSelectQuery, CriteriaDefinition, SqmSelectStatement, SqmSubQuery

public interface JpaSelectCriteria<T> extends AbstractQuery<T>, JpaCriteriaBase
Commonality between a JPA JpaCriteriaQuery and JpaSubQuery, mainly in the form of delegation to JpaQueryStructure
Author:
Steve Ebersole
  • Method Details

    • getQuerySpec

      JpaQueryStructure<T> getQuerySpec()
      The query structure. See JpaQueryStructure for details
    • getQueryPart

      JpaQueryPart<T> getQueryPart()
      The query structure. See JpaQueryStructure for details
    • from

      <X> JpaDerivedRoot<X> from(Subquery<X> subquery)
      Create and add a query root corresponding to the given subquery, forming a cartesian product with any existing roots.
      Parameters:
      subquery - the subquery
      Returns:
      query root corresponding to the given subquery
    • from

      <X> JpaRoot<X> from(JpaCteCriteria<X> cte)
      Create and add a query root corresponding to the given cte, forming a cartesian product with any existing roots.
      Parameters:
      cte - the cte criteria
      Returns:
      query root corresponding to the given cte
    • distinct

      JpaSelectCriteria<T> distinct(boolean distinct)
      Description copied from interface: AbstractQuery
      Specify whether duplicate query results will be eliminated. A true value will cause duplicates to be eliminated. A false value will cause duplicates to be retained. If distinct has not been specified, duplicate results must be retained.
      Specified by:
      distinct in interface AbstractQuery<T>
      Parameters:
      distinct - boolean value specifying whether duplicate results must be eliminated from the query result or whether they must be retained
      Returns:
      the modified query
    • getSelection

      JpaSelection<T> getSelection()
      Description copied from interface: AbstractQuery
      Return the selection of the query, or null if no selection has been set.
      Specified by:
      getSelection in interface AbstractQuery<T>
      Returns:
      selection item
    • from

      <X> JpaRoot<X> from(Class<X> entityClass)
      Description copied from interface: AbstractQuery
      Create and add a query root corresponding to the given entity, forming a cartesian product with any existing roots.
      Specified by:
      from in interface AbstractQuery<T>
      Parameters:
      entityClass - the entity class
      Returns:
      query root corresponding to the given entity
    • from

      <X> JpaRoot<X> from(EntityType<X> entity)
      Description copied from interface: AbstractQuery
      Create and add a query root corresponding to the given entity, forming a cartesian product with any existing roots.
      Specified by:
      from in interface AbstractQuery<T>
      Parameters:
      entity - metamodel entity representing the entity of type X
      Returns:
      query root corresponding to the given entity
    • getRestriction

      JpaPredicate getRestriction()
      Description copied from interface: CommonAbstractCriteria
      Return the predicate that corresponds to the where clause restriction(s), or null if no restrictions have been specified.
      Specified by:
      getRestriction in interface CommonAbstractCriteria
      Specified by:
      getRestriction in interface JpaCriteriaBase
      Returns:
      where clause predicate
    • where

      JpaSelectCriteria<T> where(Expression<Boolean> restriction)
      Description copied from interface: AbstractQuery
      Modify the query to restrict the query results according to the specified boolean expression. Replaces the previously added restriction(s), if any.
      Specified by:
      where in interface AbstractQuery<T>
      Parameters:
      restriction - a simple or compound boolean expression
      Returns:
      the modified query
    • where

      JpaSelectCriteria<T> where(Predicate... restrictions)
      Description copied from interface: AbstractQuery
      Modify the query to restrict the query results according to the conjunction of the specified restriction predicates. Replaces the previously added restriction(s), if any. If no restrictions are specified, any previously added restrictions are simply removed.
      Specified by:
      where in interface AbstractQuery<T>
      Parameters:
      restrictions - zero or more restriction predicates
      Returns:
      the modified query
    • groupBy

      JpaSelectCriteria<T> groupBy(Expression<?>... grouping)
      Description copied from interface: AbstractQuery
      Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed.
      Specified by:
      groupBy in interface AbstractQuery<T>
      Parameters:
      grouping - zero or more grouping expressions
      Returns:
      the modified query
    • groupBy

      JpaSelectCriteria<T> groupBy(List<Expression<?>> grouping)
      Description copied from interface: AbstractQuery
      Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed.
      Specified by:
      groupBy in interface AbstractQuery<T>
      Parameters:
      grouping - list of zero or more grouping expressions
      Returns:
      the modified query
    • getGroupRestriction

      JpaPredicate getGroupRestriction()
      Description copied from interface: AbstractQuery
      Return the predicate that corresponds to the restriction(s) over the grouping items, or null if no restrictions have been specified.
      Specified by:
      getGroupRestriction in interface AbstractQuery<T>
      Returns:
      having clause predicate
    • having

      JpaSelectCriteria<T> having(Expression<Boolean> restriction)
      Description copied from interface: AbstractQuery
      Specify a restriction over the groups of the query. Replaces the previous having restriction(s), if any.
      Specified by:
      having in interface AbstractQuery<T>
      Parameters:
      restriction - a simple or compound boolean expression
      Returns:
      the modified query
    • having

      JpaSelectCriteria<T> having(Predicate... restrictions)
      Description copied from interface: AbstractQuery
      Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates. Replaces the previously having added restriction(s), if any. If no restrictions are specified, any previously added restrictions are simply removed.
      Specified by:
      having in interface AbstractQuery<T>
      Parameters:
      restrictions - zero or more restriction predicates
      Returns:
      the modified query