java.lang.Object
org.eclipse.persistence.internal.jpa.querydef.CriteriaBuilderImpl
All Implemented Interfaces:
CriteriaBuilder, Serializable, JpaCriteriaBuilder

public class CriteriaBuilderImpl extends Object implements JpaCriteriaBuilder, Serializable
See Also:
  • Field Details

  • Constructor Details

    • CriteriaBuilderImpl

      public CriteriaBuilderImpl(Metamodel metamodel)
  • Method Details

    • createQuery

      public CriteriaQuery<Object> createQuery()
      Create a Criteria query object.
      Specified by:
      createQuery in interface CriteriaBuilder
      Returns:
      query object
    • createQuery

      public <T> CriteriaQuery<T> createQuery(Class<T> resultClass)
      Create a Criteria query object.
      Specified by:
      createQuery in interface CriteriaBuilder
      Returns:
      query object
    • createTupleQuery

      public CriteriaQuery<Tuple> createTupleQuery()
      Create a Criteria query object that returns a tuple of objects as its result.
      Specified by:
      createTupleQuery in interface CriteriaBuilder
      Returns:
      query object
    • construct

      public <Y> CompoundSelection<Y> construct(Class<Y> result, Selection<?>... selections)
      Define a select list item corresponding to a constructor.
      Specified by:
      construct in interface CriteriaBuilder
      Parameters:
      result - class whose instance is to be constructed
      selections - arguments to the constructor
      Returns:
      selection item
    • tuple

      public CompoundSelection<Tuple> tuple(Selection<?>... selections)
      Specified by:
      tuple in interface CriteriaBuilder
    • array

      public CompoundSelection<Object[]> array(Selection<?>... selections)
      Create an array-valued selection item
      Specified by:
      array in interface CriteriaBuilder
      Parameters:
      selections - selection items
      Returns:
      array-valued compound selection
      Throws:
      IllegalArgumentException - if an argument is a tuple- or array-valued selection item
    • asc

      public Order asc(Expression<?> x)
      Create an ordering by the ascending value of the expression.
      Specified by:
      asc in interface CriteriaBuilder
      Parameters:
      x - expression used to define the ordering
      Returns:
      ascending ordering corresponding to the expression
    • desc

      public Order desc(Expression<?> x)
      Create an ordering by the descending value of the expression.
      Specified by:
      desc in interface CriteriaBuilder
      Parameters:
      x - expression used to define the ordering
      Returns:
      descending ordering corresponding to the expression
    • avg

      public <N extends Number> Expression<Double> avg(Expression<N> x)
      Create an expression applying the avg operation.
      Specified by:
      avg in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to avg operation
      Returns:
      avg expression
    • sum

      public <N extends Number> Expression<N> sum(Expression<N> x)
      Create an expression applying the sum operation.
      Specified by:
      sum in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to sum operation
      Returns:
      sum expression
    • max

      public <N extends Number> Expression<N> max(Expression<N> x)
      Create an expression applying the numerical max operation.
      Specified by:
      max in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to max operation
      Returns:
      max expression
    • min

      public <N extends Number> Expression<N> min(Expression<N> x)
      Create an expression applying the numerical min operation.
      Specified by:
      min in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to min operation
      Returns:
      min expression
    • greatest

      public <X extends Comparable<? super X>> Expression<X> greatest(Expression<X> x)
      Create an aggregate expression for finding the greatest of the values (strings, dates, etc).
      Specified by:
      greatest in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to greatest operation
      Returns:
      greatest expression
    • least

      public <X extends Comparable<? super X>> Expression<X> least(Expression<X> x)
      Create an aggregate expression for finding the least of the values (strings, dates, etc).
      Specified by:
      least in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to least operation
      Returns:
      least expression
    • count

      public Expression<Long> count(Expression<?> x)
      Create an expression applying the count operation.
      Specified by:
      count in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to count operation
      Returns:
      count expression
    • countDistinct

      public Expression<Long> countDistinct(Expression<?> x)
      Create an expression applying the count distinct operation.
      Specified by:
      countDistinct in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to count distinct operation
      Returns:
      count distinct expression
    • exists

      public Predicate exists(Subquery<?> subquery)
      Create a predicate testing the existence of a subquery result.
      Specified by:
      exists in interface CriteriaBuilder
      Parameters:
      subquery - subquery whose result is to be tested
      Returns:
      exists predicate
    • all

      public <Y> Expression<Y> all(Subquery<Y> subquery)
      Create a predicate corresponding to an all expression over the subquery results.
      Specified by:
      all in interface CriteriaBuilder
      Returns:
      all expression
    • some

      public <Y> Expression<Y> some(Subquery<Y> subquery)
      Create a predicate corresponding to a some expression over the subquery results. This is equivalent to an any expression.
      Specified by:
      some in interface CriteriaBuilder
      Returns:
      all expression
    • any

      public <Y> Expression<Y> any(Subquery<Y> subquery)
      Create a predicate corresponding to an any expression over the subquery results. This is equivalent to a some expression.
      Specified by:
      any in interface CriteriaBuilder
      Returns:
      any expression
    • and

      Create a conjunction of the given boolean expressions.
      Specified by:
      and in interface CriteriaBuilder
      Parameters:
      x - boolean expression
      y - boolean expression
      Returns:
      and predicate
    • or

      Create a disjunction of the given boolean expressions.
      Specified by:
      or in interface CriteriaBuilder
      Parameters:
      x - boolean expression
      y - boolean expression
      Returns:
      or predicate
    • and

      public Predicate and(Predicate... restrictions)
      Create a conjunction of the given restriction predicates. A conjunction of zero predicates is true.
      Specified by:
      and in interface CriteriaBuilder
      Parameters:
      restrictions - zero or more restriction predicates
      Returns:
      and predicate
    • or

      public Predicate or(Predicate... restrictions)
      Create a disjunction of the given restriction predicates. A disjunction of zero predicates is false.
      Specified by:
      or in interface CriteriaBuilder
      Parameters:
      restrictions - zero or more restriction predicates
      Returns:
      and predicate
    • not

      public Predicate not(Expression<Boolean> restriction)
      Create a negation of the given restriction.
      Specified by:
      not in interface CriteriaBuilder
      Parameters:
      restriction - restriction expression
      Returns:
      not predicate
    • conjunction

      public Predicate conjunction()
      Create a conjunction (with zero conjuncts). A conjunction with zero conjuncts is true.
      Specified by:
      conjunction in interface CriteriaBuilder
      Returns:
      and predicate
    • disjunction

      public Predicate disjunction()
      Create a disjunction (with zero disjuncts). A disjunction with zero disjuncts is false.
      Specified by:
      disjunction in interface CriteriaBuilder
      Returns:
      or predicate
    • isTrue

      public Predicate isTrue(Expression<Boolean> x)
      Create a predicate testing for a true value.
      Specified by:
      isTrue in interface CriteriaBuilder
      Parameters:
      x - expression to be tested if true
      Returns:
      predicate
    • isFalse

      public Predicate isFalse(Expression<Boolean> x)
      Create a predicate testing for a false value.
      Specified by:
      isFalse in interface CriteriaBuilder
      Parameters:
      x - expression to be tested if false
      Returns:
      predicate
    • isNull

      public Predicate isNull(Expression<?> x)
      Create a predicate to test whether the expression is null.
      Specified by:
      isNull in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      predicate
    • isNotNull

      public Predicate isNotNull(Expression<?> x)
      Create a predicate to test whether the expression is not null.
      Specified by:
      isNotNull in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      predicate
    • equal

      public Predicate equal(Expression<?> x, Expression<?> y)
      Create a predicate for testing the arguments for equality.
      Specified by:
      equal in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      equality predicate
    • notEqual

      public Predicate notEqual(Expression<?> x, Expression<?> y)
      Create a predicate for testing the arguments for inequality.
      Specified by:
      notEqual in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      inequality predicate
    • equal

      public Predicate equal(Expression<?> x, Object y)
      Create a predicate for testing the arguments for equality.
      Specified by:
      equal in interface CriteriaBuilder
      Parameters:
      x - expression
      y - object
      Returns:
      equality predicate
    • notEqual

      public Predicate notEqual(Expression<?> x, Object y)
      Create a predicate for testing the arguments for inequality.
      Specified by:
      notEqual in interface CriteriaBuilder
      Parameters:
      x - expression
      y - object
      Returns:
      inequality predicate
    • greaterThan

      public <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x, Expression<? extends Y> y)
      Create a predicate for testing whether the first argument is greater than the second.
      Specified by:
      greaterThan in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      greater-than predicate
    • lessThan

      public <Y extends Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x, Expression<? extends Y> y)
      Create a predicate for testing whether the first argument is less than the second.
      Specified by:
      lessThan in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      less-than predicate
    • greaterThanOrEqualTo

      public <Y extends Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y)
      Create a predicate for testing whether the first argument is greater than or equal to the second.
      Specified by:
      greaterThanOrEqualTo in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      greater-than-or-equal predicate
    • lessThanOrEqualTo

      public <Y extends Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y)
      Create a predicate for testing whether the first argument is less than or equal to the second.
      Specified by:
      lessThanOrEqualTo in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      less-than-or-equal predicate
    • between

      public <Y extends Comparable<? super Y>> Predicate between(Expression<? extends Y> v, Expression<? extends Y> x, Expression<? extends Y> y)
      Create a predicate for testing whether the first argument is between the second and third arguments in value.
      Specified by:
      between in interface CriteriaBuilder
      Parameters:
      v - expression
      x - expression
      y - expression
      Returns:
      between predicate
    • greaterThan

      public <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x, Y y)
      Create a predicate for testing whether the first argument is greater than the second.
      Specified by:
      greaterThan in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      greater-than predicate
    • lessThan

      public <Y extends Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x, Y y)
      Create a predicate for testing whether the first argument is less than the second.
      Specified by:
      lessThan in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      less-than predicate
    • greaterThanOrEqualTo

      public <Y extends Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x, Y y)
      Create a predicate for testing whether the first argument is greater than or equal to the second.
      Specified by:
      greaterThanOrEqualTo in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      greater-than-or-equal predicate
    • lessThanOrEqualTo

      public <Y extends Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x, Y y)
      Create a predicate for testing whether the first argument is less than or equal to the second.
      Specified by:
      lessThanOrEqualTo in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      less-than-or-equal predicate
    • between

      public <Y extends Comparable<? super Y>> Predicate between(Expression<? extends Y> v, Y x, Y y)
      Create a predicate for testing whether the first argument is between the second and third arguments in value.
      Specified by:
      between in interface CriteriaBuilder
      Parameters:
      v - expression
      x - value
      y - value
      Returns:
      between predicate
    • buildList

      protected List<Expression<?>> buildList(Expression<?>... expressions)
    • gt

      public Predicate gt(Expression<? extends Number> x, Expression<? extends Number> y)
      Create a predicate for testing whether the first argument is greater than the second.
      Specified by:
      gt in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      greater-than predicate
    • lt

      public Predicate lt(Expression<? extends Number> x, Expression<? extends Number> y)
      Create a predicate for testing whether the first argument is less than the second.
      Specified by:
      lt in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      less-than predicate
    • ge

      public Predicate ge(Expression<? extends Number> x, Expression<? extends Number> y)
      Create a predicate for testing whether the first argument is greater than or equal to the second.
      Specified by:
      ge in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      greater-than-or-equal predicate
    • le

      public Predicate le(Expression<? extends Number> x, Expression<? extends Number> y)
      Create a predicate for testing whether the first argument is less than or equal to the second.
      Specified by:
      le in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      less-than-or-equal predicate
    • gt

      public Predicate gt(Expression<? extends Number> x, Number y)
      Create a predicate for testing whether the first argument is greater than the second.
      Specified by:
      gt in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      greater-than predicate
    • lt

      public Predicate lt(Expression<? extends Number> x, Number y)
      Create a predicate for testing whether the first argument is less than the second.
      Specified by:
      lt in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      less-than predicate
    • ge

      public Predicate ge(Expression<? extends Number> x, Number y)
      Create a predicate for testing whether the first argument is greater than or equal to the second.
      Specified by:
      ge in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      greater-than-or-equal predicate
    • le

      public Predicate le(Expression<? extends Number> x, Number y)
      Create a predicate for testing whether the first argument is less than or equal to the second.
      Specified by:
      le in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      less-than-or-equal predicate
    • neg

      public <N extends Number> Expression<N> neg(Expression<N> x)
      Create an expression that returns the arithmetic negation of its argument.
      Specified by:
      neg in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      negated expression
    • abs

      public <N extends Number> Expression<N> abs(Expression<N> x)
      Create an expression that returns the absolute value of its argument.
      Specified by:
      abs in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      absolute value
    • sum

      public <N extends Number> Expression<N> sum(Expression<? extends N> x, Expression<? extends N> y)
      Create an expression that returns the sum of its arguments.
      Specified by:
      sum in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      sum
    • sumAsLong

      public Expression<Long> sumAsLong(Expression<Integer> x)
      Create an aggregate expression applying the sum operation to an Integer-valued expression, returning a Long result.
      Specified by:
      sumAsLong in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to sum operation
      Returns:
      sum expression
    • sumAsDouble

      public Expression<Double> sumAsDouble(Expression<Float> x)
      Create an aggregate expression applying the sum operation to a Float-valued expression, returning a Double result.
      Specified by:
      sumAsDouble in interface CriteriaBuilder
      Parameters:
      x - expression representing input value to sum operation
      Returns:
      sum expression
    • prod

      public <N extends Number> Expression<N> prod(Expression<? extends N> x, Expression<? extends N> y)
      Create an expression that returns the product of its arguments.
      Specified by:
      prod in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      product
    • diff

      public <N extends Number> Expression<N> diff(Expression<? extends N> x, Expression<? extends N> y)
      Create an expression that returns the difference between its arguments.
      Specified by:
      diff in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      difference
    • sum

      public <N extends Number> Expression<N> sum(Expression<? extends N> x, N y)
      Create an expression that returns the sum of its arguments.
      Specified by:
      sum in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      sum
    • prod

      public <N extends Number> Expression<N> prod(Expression<? extends N> x, N y)
      Create an expression that returns the product of its arguments.
      Specified by:
      prod in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      product
    • diff

      public <N extends Number> Expression<N> diff(Expression<? extends N> x, N y)
      Create an expression that returns the difference between its arguments.
      Specified by:
      diff in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      difference
    • sum

      public <N extends Number> Expression<N> sum(N x, Expression<? extends N> y)
      Create an expression that returns the sum of its arguments.
      Specified by:
      sum in interface CriteriaBuilder
      Parameters:
      x - value
      y - expression
      Returns:
      sum
    • prod

      public <N extends Number> Expression<N> prod(N x, Expression<? extends N> y)
      Create an expression that returns the product of its arguments.
      Specified by:
      prod in interface CriteriaBuilder
      Parameters:
      x - value
      y - expression
      Returns:
      product
    • diff

      public <N extends Number> Expression<N> diff(N x, Expression<? extends N> y)
      Create an expression that returns the difference between its arguments.
      Specified by:
      diff in interface CriteriaBuilder
      Parameters:
      x - value
      y - expression
      Returns:
      difference
    • quot

      public Expression<Number> quot(Expression<? extends Number> x, Expression<? extends Number> y)
      Create an expression that returns the quotient of its arguments.
      Specified by:
      quot in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      quotient
    • quot

      public Expression<Number> quot(Expression<? extends Number> x, Number y)
      Create an expression that returns the quotient of its arguments.
      Specified by:
      quot in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      quotient
    • quot

      public Expression<Number> quot(Number x, Expression<? extends Number> y)
      Create an expression that returns the quotient of its arguments.
      Specified by:
      quot in interface CriteriaBuilder
      Parameters:
      x - value
      y - expression
      Returns:
      quotient
    • mod

      Create an expression that returns the modulus of its arguments.
      Specified by:
      mod in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      modulus
    • mod

      Create an expression that returns the modulus of its arguments.
      Specified by:
      mod in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      modulus
    • mod

      Create an expression that returns the modulus of its arguments.
      Specified by:
      mod in interface CriteriaBuilder
      Parameters:
      x - value
      y - expression
      Returns:
      modulus
    • sqrt

      public Expression<Double> sqrt(Expression<? extends Number> x)
      Create an expression that returns the square root of its argument.
      Specified by:
      sqrt in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      modulus
    • sign

      public Expression<Integer> sign(Expression<? extends Number> x)
      Create an expression that returns the sign of its argument, that is, 1 if its argument is positive, -1 if its argument is negative, or 0 if its argument is exactly zero.
      Specified by:
      sign in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      sign
    • ceiling

      public <N extends Number> Expression<N> ceiling(Expression<N> x)
      Create an expression that returns the ceiling of its argument, that is, the smallest integer greater than or equal to its argument.
      Specified by:
      ceiling in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      ceiling
    • floor

      public <N extends Number> Expression<N> floor(Expression<N> x)
      Create an expression that returns the floor of its argument, that is, the largest integer smaller than or equal to its argument.
      Specified by:
      floor in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      floor
    • exp

      public Expression<Double> exp(Expression<? extends Number> x)
      Create an expression that returns the exponential of its argument, that is, Euler's number e raised to the power of its argument.
      Specified by:
      exp in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      exponential
    • ln

      public Expression<Double> ln(Expression<? extends Number> x)
      Create an expression that returns the natural logarithm of its argument.
      Specified by:
      ln in interface CriteriaBuilder
      Parameters:
      x - expression
      Returns:
      natural logarithm
    • power

      public Expression<Double> power(Expression<? extends Number> x, Expression<? extends Number> y)
      Create an expression that returns the first argument raised to the power of its second argument.
      Specified by:
      power in interface CriteriaBuilder
      Parameters:
      x - base
      y - exponent
      Returns:
      the base raised to the power of the exponent
    • power

      public Expression<Double> power(Expression<? extends Number> x, Number y)
      Create an expression that returns the first argument raised to the power of its second argument.
      Specified by:
      power in interface CriteriaBuilder
      Parameters:
      x - base
      y - exponent
      Returns:
      the base raised to the power of the exponent
    • round

      public <T extends Number> Expression<T> round(Expression<T> x, Integer n)
      Create an expression that returns the first argument rounded to the number of decimal places given by the second argument.
      Specified by:
      round in interface CriteriaBuilder
      Parameters:
      x - base
      n - number of decimal places
      Returns:
      the rounded value
    • toLong

      public Expression<Long> toLong(Expression<? extends Number> number)
      Typecast.
      Specified by:
      toLong in interface CriteriaBuilder
      Parameters:
      number - numeric expression
      Returns:
      Expression<Long>
    • toInteger

      public Expression<Integer> toInteger(Expression<? extends Number> number)
      Typecast.
      Specified by:
      toInteger in interface CriteriaBuilder
      Parameters:
      number - numeric expression
      Returns:
      Expression<Integer>
    • toFloat

      public Expression<Float> toFloat(Expression<? extends Number> number)
      Typecast.
      Specified by:
      toFloat in interface CriteriaBuilder
      Parameters:
      number - numeric expression
      Returns:
      Expression<Float>
    • toDouble

      public Expression<Double> toDouble(Expression<? extends Number> number)
      Typecast.
      Specified by:
      toDouble in interface CriteriaBuilder
      Parameters:
      number - numeric expression
      Returns:
      Expression<Double>
    • toBigDecimal

      public Expression<BigDecimal> toBigDecimal(Expression<? extends Number> number)
      Typecast.
      Specified by:
      toBigDecimal in interface CriteriaBuilder
      Parameters:
      number - numeric expression
      Returns:
      Expression<BigDecimal>
    • toBigInteger

      public Expression<BigInteger> toBigInteger(Expression<? extends Number> number)
      Typecast.
      Specified by:
      toBigInteger in interface CriteriaBuilder
      Parameters:
      number - numeric expression
      Returns:
      Expression<BigInteger>
    • toString

      public Expression<String> toString(Expression<Character> character)
      Typecast.
      Specified by:
      toString in interface CriteriaBuilder
      Parameters:
      character - expression
      Returns:
      Expression<String>
    • literal

      public <T> Expression<T> literal(T value)
      Create an expression literal.
      Specified by:
      literal in interface CriteriaBuilder
      Returns:
      expression literal
    • nullLiteral

      public <T> Expression<T> nullLiteral(Class<T> resultClass)
      Create an expression for a null literal with the given type.
      Specified by:
      nullLiteral in interface CriteriaBuilder
      Parameters:
      resultClass - type of the null literal
      Returns:
      null expression literal
    • internalLiteral

      protected <T> Expression<T> internalLiteral(T value)
      Create an expression literal but without null validation.
      Returns:
      expression literal
    • parameter

      public <T> ParameterExpression<T> parameter(Class<T> paramClass)
      Create a parameter. Create a parameter expression.
      Specified by:
      parameter in interface CriteriaBuilder
      Parameters:
      paramClass - parameter class
      Returns:
      parameter expression
    • parameter

      public <T> ParameterExpression<T> parameter(Class<T> paramClass, String name)
      Create a parameter expression with the given name.
      Specified by:
      parameter in interface CriteriaBuilder
      Parameters:
      paramClass - parameter class
      Returns:
      parameter
    • isEmpty

      public <C extends Collection<?>> Predicate isEmpty(Expression<C> collection)
      Create a predicate that tests whether a collection is empty.
      Specified by:
      isEmpty in interface CriteriaBuilder
      Parameters:
      collection - expression
      Returns:
      predicate
    • isNotEmpty

      public <C extends Collection<?>> Predicate isNotEmpty(Expression<C> collection)
      Create a predicate that tests whether a collection is not empty.
      Specified by:
      isNotEmpty in interface CriteriaBuilder
      Parameters:
      collection - expression
      Returns:
      predicate
    • size

      public <C extends Collection<?>> Expression<Integer> size(C collection)
      Create an expression that tests the size of a collection.
      Specified by:
      size in interface CriteriaBuilder
      Returns:
      size expression
    • size

      public <C extends Collection<?>> Expression<Integer> size(Expression<C> collection)
      Create an expression that tests the size of a collection.
      Specified by:
      size in interface CriteriaBuilder
      Parameters:
      collection - expression
      Returns:
      size expression
    • isMember

      public <E, C extends Collection<E>> Predicate isMember(E elem, Expression<C> collection)
      Create a predicate that tests whether an element is a member of a collection.
      Specified by:
      isMember in interface CriteriaBuilder
      Parameters:
      elem - element
      collection - expression
      Returns:
      predicate
    • isNotMember

      public <E, C extends Collection<E>> Predicate isNotMember(E elem, Expression<C> collection)
      Create a predicate that tests whether an element is not a member of a collection.
      Specified by:
      isNotMember in interface CriteriaBuilder
      Parameters:
      elem - element
      collection - expression
      Returns:
      predicate
    • isMember

      public <E, C extends Collection<E>> Predicate isMember(Expression<E> elem, Expression<C> collection)
      Create a predicate that tests whether an element is a member of a collection.
      Specified by:
      isMember in interface CriteriaBuilder
      Parameters:
      elem - element expression
      collection - expression
      Returns:
      predicate
    • isNotMember

      public <E, C extends Collection<E>> Predicate isNotMember(Expression<E> elem, Expression<C> collection)
      Create a predicate that tests whether an element is not a member of a collection.
      Specified by:
      isNotMember in interface CriteriaBuilder
      Parameters:
      elem - element expression
      collection - expression
      Returns:
      predicate
    • values

      public <V, M extends Map<?, V>> Expression<Collection<V>> values(M map)
      Create an expression that returns the values of a map.
      Specified by:
      values in interface CriteriaBuilder
      Returns:
      collection expression
    • keys

      public <K, M extends Map<K, ?>> Expression<Set<K>> keys(M map)
      Create an expression that returns the keys of a map.
      Specified by:
      keys in interface CriteriaBuilder
      Returns:
      set expression
    • like

      public Predicate like(Expression<String> x, Expression<String> pattern)
      Create a predicate for testing whether the expression satisfies the given pattern.
      Specified by:
      like in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string expression
      Returns:
      like predicate
    • like

      public Predicate like(Expression<String> x, Expression<String> pattern, Expression<Character> escapeChar)
      Create a predicate for testing whether the expression satisfies the given pattern.
      Specified by:
      like in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string expression
      escapeChar - escape character expression
      Returns:
      like predicate
    • like

      public Predicate like(Expression<String> x, Expression<String> pattern, char escapeChar)
      Create a predicate for testing whether the expression satisfies the given pattern.
      Specified by:
      like in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string expression
      escapeChar - escape character
      Returns:
      like predicate
    • like

      public Predicate like(Expression<String> x, String pattern)
      Create a predicate for testing whether the expression satisfies the given pattern.
      Specified by:
      like in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string
      Returns:
      like predicate
    • like

      public Predicate like(Expression<String> x, String pattern, Expression<Character> escapeChar)
      Create a predicate for testing whether the expression satisfies the given pattern.
      Specified by:
      like in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string
      escapeChar - escape character expression
      Returns:
      like predicate
    • like

      public Predicate like(Expression<String> x, String pattern, char escapeChar)
      Create a predicate for testing whether the expression satisfies the given pattern.
      Specified by:
      like in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string
      escapeChar - escape character
      Returns:
      like predicate
    • notLike

      public Predicate notLike(Expression<String> x, Expression<String> pattern)
      Create a predicate for testing whether the expression does not satisfy the given pattern.
      Specified by:
      notLike in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string expression
      Returns:
      like predicate
    • notLike

      public Predicate notLike(Expression<String> x, Expression<String> pattern, Expression<Character> escapeChar)
      Create a predicate for testing whether the expression does not satisfy the given pattern.
      Specified by:
      notLike in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string expression
      escapeChar - escape character expression
      Returns:
      like predicate
    • notLike

      public Predicate notLike(Expression<String> x, Expression<String> pattern, char escapeChar)
      Create a predicate for testing whether the expression does not satisfy the given pattern.
      Specified by:
      notLike in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string expression
      escapeChar - escape character
      Returns:
      like predicate
    • notLike

      public Predicate notLike(Expression<String> x, String pattern)
      Create a predicate for testing whether the expression does not satisfy the given pattern.
      Specified by:
      notLike in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string
      Returns:
      like predicate
    • notLike

      public Predicate notLike(Expression<String> x, String pattern, Expression<Character> escapeChar)
      Create a predicate for testing whether the expression does not satisfy the given pattern.
      Specified by:
      notLike in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string
      escapeChar - escape character expression
      Returns:
      like predicate
    • notLike

      public Predicate notLike(Expression<String> x, String pattern, char escapeChar)
      Create a predicate for testing whether the expression does not satisfy the given pattern.
      Specified by:
      notLike in interface CriteriaBuilder
      Parameters:
      x - string expression
      pattern - string
      escapeChar - escape character
      Returns:
      like predicate
    • concat

      public Expression<String> concat(Expression<String> x, Expression<String> y)
      String concatenation operation.
      Specified by:
      concat in interface CriteriaBuilder
      Parameters:
      x - string expression
      y - string expression
      Returns:
      expression corresponding to concatenation
    • concat

      public Expression<String> concat(Expression<String> x, String y)
      String concatenation operation.
      Specified by:
      concat in interface CriteriaBuilder
      Parameters:
      x - string expression
      y - string
      Returns:
      expression corresponding to concatenation
    • concat

      public Expression<String> concat(String x, Expression<String> y)
      String concatenation operation.
      Specified by:
      concat in interface CriteriaBuilder
      Parameters:
      x - string
      y - string expression
      Returns:
      expression corresponding to concatenation
    • substring

      public Expression<String> substring(Expression<String> x, Expression<Integer> from)
      Substring extraction operation. Extracts a substring starting at specified position through to end of the string. First position is 1.
      Specified by:
      substring in interface CriteriaBuilder
      Parameters:
      x - string expression
      from - start position expression
      Returns:
      expression corresponding to substring extraction
    • substring

      public Expression<String> substring(Expression<String> x, int from)
      Substring extraction operation. Extracts a substring starting at specified position through to end of the string. First position is 1.
      Specified by:
      substring in interface CriteriaBuilder
      Parameters:
      x - string expression
      from - start position
      Returns:
      expression corresponding to substring extraction
    • substring

      public Expression<String> substring(Expression<String> x, Expression<Integer> from, Expression<Integer> len)
      Substring extraction operation. Extracts a substring of given length starting at specified position. First position is 1.
      Specified by:
      substring in interface CriteriaBuilder
      Parameters:
      x - string expression
      from - start position expression
      len - length expression
      Returns:
      expression corresponding to substring extraction
    • substring

      public Expression<String> substring(Expression<String> x, int from, int len)
      Substring extraction operation. Extracts a substring of given length starting at specified position. First position is 1.
      Specified by:
      substring in interface CriteriaBuilder
      Parameters:
      x - string expression
      from - start position
      len - length
      Returns:
      expression corresponding to substring extraction
    • trim

      public Expression<String> trim(Expression<String> x)
      Create expression to trim blanks from both ends of a string.
      Specified by:
      trim in interface CriteriaBuilder
      Parameters:
      x - expression for string to trim
      Returns:
      trim expression
    • trim

      Create expression to trim blanks from a string.
      Specified by:
      trim in interface CriteriaBuilder
      Parameters:
      ts - trim specification
      x - expression for string to trim
      Returns:
      trim expression
    • trim

      Create expression to trim character from both ends of a string.
      Specified by:
      trim in interface CriteriaBuilder
      Parameters:
      t - expression for character to be trimmed
      x - expression for string to trim
      Returns:
      trim expression
    • trim

      Create expression to trim character from a string.
      Specified by:
      trim in interface CriteriaBuilder
      Parameters:
      ts - trim specification
      t - expression for character to be trimmed
      x - expression for string to trim
      Returns:
      trim expression
    • trim

      public Expression<String> trim(char t, Expression<String> x)
      Create expression to trim character from both ends of a string.
      Specified by:
      trim in interface CriteriaBuilder
      Parameters:
      t - character to be trimmed
      x - expression for string to trim
      Returns:
      trim expression
    • trim

      public Expression<String> trim(CriteriaBuilder.Trimspec ts, char t, Expression<String> x)
      Create expression to trim character from a string.
      Specified by:
      trim in interface CriteriaBuilder
      Parameters:
      ts - trim specification
      t - character to be trimmed
      x - expression for string to trim
      Returns:
      trim expression
    • lower

      public Expression<String> lower(Expression<String> x)
      Create expression for converting a string to lowercase.
      Specified by:
      lower in interface CriteriaBuilder
      Parameters:
      x - string expression
      Returns:
      expression to convert to lowercase
    • upper

      public Expression<String> upper(Expression<String> x)
      Create expression for converting a string to uppercase.
      Specified by:
      upper in interface CriteriaBuilder
      Parameters:
      x - string expression
      Returns:
      expression to convert to uppercase
    • length

      public Expression<Integer> length(Expression<String> x)
      Create expression to return length of a string.
      Specified by:
      length in interface CriteriaBuilder
      Parameters:
      x - string expression
      Returns:
      length expression
    • locate

      public Expression<Integer> locate(Expression<String> x, Expression<String> pattern)
      Create expression to locate the position of one string within another, returning position of first character if found. The first position in a string is denoted by 1. If the string to be located is not found, 0 is returned.
      Specified by:
      locate in interface CriteriaBuilder
      Parameters:
      x - expression for string to be searched
      pattern - expression for string to be located
      Returns:
      expression corresponding to position
    • locate

      public Expression<Integer> locate(Expression<String> x, Expression<String> pattern, Expression<Integer> from)
      Create expression to locate the position of one string within another, returning position of first character if found. The first position in a string is denoted by 1. If the string to be located is not found, 0 is returned.
      Specified by:
      locate in interface CriteriaBuilder
      Parameters:
      x - expression for string to be searched
      pattern - expression for string to be located
      from - expression for position at which to start search
      Returns:
      expression corresponding to position
    • locate

      public Expression<Integer> locate(Expression<String> x, String pattern)
      Create expression to locate the position of one string within another, returning position of first character if found. The first position in a string is denoted by 1. If the string to be located is not found, 0 is returned.
      Specified by:
      locate in interface CriteriaBuilder
      Parameters:
      x - expression for string to be searched
      pattern - string to be located
      Returns:
      expression corresponding to position
    • locate

      public Expression<Integer> locate(Expression<String> x, String pattern, int from)
      Create expression to locate the position of one string within another, returning position of first character if found. The first position in a string is denoted by 1. If the string to be located is not found, 0 is returned.
      Specified by:
      locate in interface CriteriaBuilder
      Parameters:
      x - expression for string to be searched
      pattern - string to be located
      from - position at which to start search
      Returns:
      expression corresponding to position
    • currentDate

      public Expression<Date> currentDate()
      Create expression to return current date.
      Specified by:
      currentDate in interface CriteriaBuilder
      Returns:
      expression for current date
    • currentTimestamp

      public Expression<Timestamp> currentTimestamp()
      Create expression to return current timestamp.
      Specified by:
      currentTimestamp in interface CriteriaBuilder
      Returns:
      expression for current timestamp
    • currentTime

      public Expression<Time> currentTime()
      Create expression to return current time.
      Specified by:
      currentTime in interface CriteriaBuilder
      Returns:
      expression for current time
    • localDateTime

      public Expression<LocalDateTime> localDateTime()
      Create expression to return local datetime.
      Specified by:
      localDateTime in interface CriteriaBuilder
      Returns:
      expression for local timestamp
    • localDate

      public Expression<LocalDate> localDate()
      Create expression to return local date.
      Specified by:
      localDate in interface CriteriaBuilder
      Returns:
      expression for local date
    • localTime

      public Expression<LocalTime> localTime()
      Create expression to return local time.
      Specified by:
      localTime in interface CriteriaBuilder
      Returns:
      expression for local time
    • in

      public <T> CriteriaBuilder.In<T> in(Expression<? extends T> expression)
      Create predicate to test whether given expression is contained in a list of values.
      Specified by:
      in in interface CriteriaBuilder
      Parameters:
      expression - to be tested against list of values
      Returns:
      in predicate
    • coalesce

      public <Y> Expression<Y> coalesce(Expression<? extends Y> x, Expression<? extends Y> y)
      Create an expression that returns null if all its arguments evaluate to null, and the value of the first non-null argument otherwise.
      Specified by:
      coalesce in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      expression corresponding to the given coalesce expression
    • coalesce

      public <Y> Expression<Y> coalesce(Expression<? extends Y> x, Y y)
      Create an expression that returns null if all its arguments evaluate to null, and the value of the first non-null argument otherwise.
      Specified by:
      coalesce in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      coalesce expression
    • nullif

      public <Y> Expression<Y> nullif(Expression<Y> x, Expression<?> y)
      Create an expression that tests whether its argument are equal, returning null if they are and the value of the first expression if they are not.
      Specified by:
      nullif in interface CriteriaBuilder
      Parameters:
      x - expression
      y - expression
      Returns:
      expression corresponding to the given nullif expression
    • nullif

      public <Y> Expression<Y> nullif(Expression<Y> x, Y y)
      Create an expression that tests whether its argument are equal, returning null if they are and the value of the first expression if they are not.
      Specified by:
      nullif in interface CriteriaBuilder
      Parameters:
      x - expression
      y - value
      Returns:
      expression corresponding to the given nullif expression
    • coalesce

      public <T> CriteriaBuilder.Coalesce<T> coalesce()
      Create a coalesce expression.
      Specified by:
      coalesce in interface CriteriaBuilder
      Returns:
      coalesce expression
    • selectCase

      public <C, R> CriteriaBuilder.SimpleCase<C,R> selectCase(Expression<? extends C> expression)
      Create simple case expression.
      Specified by:
      selectCase in interface CriteriaBuilder
      Parameters:
      expression - to be tested against the case conditions
      Returns:
      simple case expression
    • selectCase

      public <R> CriteriaBuilder.Case<R> selectCase()
      Create a general case expression.
      Specified by:
      selectCase in interface CriteriaBuilder
      Returns:
      general case expression
    • function

      public <T> Expression<T> function(String name, Class<T> type, Expression<?>... args)
      Create an expression for execution of a database function.
      Specified by:
      function in interface CriteriaBuilder
      Parameters:
      name - function name
      type - expected result type
      args - function arguments
      Returns:
      expression
    • fromExpression

      public <T> Expression<T> fromExpression(Expression expression, Class<T> type)
      ADVANCED: Allow a Criteria Expression to be built from a EclipseLink native API Expression object. This allows for an extended functionality supported in EclipseLink Expressions to be used in Criteria.
      Specified by:
      fromExpression in interface JpaCriteriaBuilder
    • fromExpression

      public Expression fromExpression(Expression expression)
      ADVANCED: Allow a Criteria Expression to be built from a EclipseLink native API Expression object. This allows for an extended functionality supported in EclipseLink Expressions to be used in Criteria.
      Specified by:
      fromExpression in interface JpaCriteriaBuilder
    • toExpression

      public Expression toExpression(Expression expression)
      ADVANCED: Allow a Criteria Expression to be converted to a EclipseLink native API Expression object. This allows for roots and paths defined in the Criteria to be used with EclipseLink native API Expresions.
      Specified by:
      toExpression in interface JpaCriteriaBuilder
    • createCriteriaDelete

      public <T> CriteriaDelete<T> createCriteriaDelete(Class<T> targetEntity)
      Specified by:
      createCriteriaDelete in interface CriteriaBuilder
    • createCriteriaUpdate

      public <T> CriteriaUpdate<T> createCriteriaUpdate(Class<T> targetEntity)
      Specified by:
      createCriteriaUpdate in interface CriteriaBuilder
    • treat

      public <X, T, V extends T> Join<X,V> treat(Join<X,T> join, Class<V> type)
      Specified by:
      treat in interface CriteriaBuilder
    • treat

      public <X, T, E extends T> CollectionJoin<X,E> treat(CollectionJoin<X,T> join, Class<E> type)
      Specified by:
      treat in interface CriteriaBuilder
    • treat

      public <X, T, E extends T> SetJoin<X,E> treat(SetJoin<X,T> join, Class<E> type)
      Specified by:
      treat in interface CriteriaBuilder
    • treat

      public <X, T, E extends T> ListJoin<X,E> treat(ListJoin<X,T> join, Class<E> type)
      Specified by:
      treat in interface CriteriaBuilder
    • treat

      public <X, K, T, V extends T> MapJoin<X,K,V> treat(MapJoin<X,K,T> join, Class<V> type)
      Specified by:
      treat in interface CriteriaBuilder
    • treat

      public <X, T extends X> Path<T> treat(Path<X> path, Class<T> type)
      Specified by:
      treat in interface CriteriaBuilder
    • treat

      public <X, T extends X> Root<T> treat(Root<X> root, Class<T> type)
      Specified by:
      treat in interface CriteriaBuilder