public interface CriteriaBuilder
Note that Predicate
is used instead of Expression<Boolean>
in this API in order to work around the fact that Java
generics are not compatible with varags.
Modifier and Type | Interface and Description |
---|---|
static interface |
CriteriaBuilder.Case<R>
Interface used to build general case expressions.
|
static interface |
CriteriaBuilder.Coalesce<T>
Interface used to build coalesce expressions.
|
static interface |
CriteriaBuilder.In<T>
Interface used to build in predicates.
|
static interface |
CriteriaBuilder.SimpleCase<C,R>
Interface used to build simple case expressions.
|
static class |
CriteriaBuilder.Trimspec
Used to specify how strings are trimmed.
|
Modifier and Type | Method and Description |
---|---|
<N extends java.lang.Number> |
abs(Expression<N> x)
Create an expression that returns the absolute value
of its argument.
|
<Y> Expression<Y> |
all(Subquery<Y> subquery)
Create an all expression over the subquery results.
|
Predicate |
and(Expression<java.lang.Boolean> x,
Expression<java.lang.Boolean> y)
Create a conjunction of the given boolean expressions.
|
Predicate |
and(Predicate... restrictions)
Create a conjunction of the given restriction predicates.
|
<Y> Expression<Y> |
any(Subquery<Y> subquery)
Create an any expression over the subquery results.
|
CompoundSelection<java.lang.Object[]> |
array(Selection<?>... selections)
Create an array-valued selection item.
|
Order |
asc(Expression<?> x)
Create an ordering by the ascending value of the expression.
|
<N extends java.lang.Number> |
avg(Expression<N> x)
Create an aggregate expression applying the avg operation.
|
<Y extends java.lang.Comparable<? super Y>> |
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.
|
<Y extends java.lang.Comparable<? super Y>> |
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.
|
<N extends java.lang.Number> |
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.
|
<T> CriteriaBuilder.Coalesce<T> |
coalesce()
Create a coalesce expression.
|
<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.
|
<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.
|
Expression<java.lang.String> |
concat(Expression<java.lang.String> x,
Expression<java.lang.String> y)
Create an expression for string concatenation.
|
Expression<java.lang.String> |
concat(Expression<java.lang.String> x,
java.lang.String y)
Create an expression for string concatenation.
|
Expression<java.lang.String> |
concat(java.lang.String x,
Expression<java.lang.String> y)
Create an expression for string concatenation.
|
Predicate |
conjunction()
Create a conjunction (with zero conjuncts).
|
<Y> CompoundSelection<Y> |
construct(java.lang.Class<Y> resultClass,
Selection<?>... selections)
Create a selection item corresponding to a constructor.
|
Expression<java.lang.Long> |
count(Expression<?> x)
Create an aggregate expression applying the count operation.
|
Expression<java.lang.Long> |
countDistinct(Expression<?> x)
Create an aggregate expression applying the count distinct
operation.
|
<T> CriteriaDelete<T> |
createCriteriaDelete(java.lang.Class<T> targetEntity)
Create a
CriteriaDelete query object to perform a bulk delete operation. |
<T> CriteriaUpdate<T> |
createCriteriaUpdate(java.lang.Class<T> targetEntity)
Create a
CriteriaUpdate query object to perform a bulk update operation. |
CriteriaQuery<java.lang.Object> |
createQuery()
Create a
CriteriaQuery object. |
<T> CriteriaQuery<T> |
createQuery(java.lang.Class<T> resultClass)
Create a
CriteriaQuery object with the specified result
type. |
CriteriaQuery<Tuple> |
createTupleQuery()
Create a
CriteriaQuery object that returns a tuple of
objects as its result. |
Expression<java.sql.Date> |
currentDate()
Create expression to return current date.
|
Expression<java.sql.Time> |
currentTime()
Create expression to return current time.
|
Expression<java.sql.Timestamp> |
currentTimestamp()
Create expression to return current timestamp.
|
Order |
desc(Expression<?> x)
Create an ordering by the descending value of the expression.
|
<N extends java.lang.Number> |
diff(Expression<? extends N> x,
Expression<? extends N> y)
Create an expression that returns the difference
between its arguments.
|
<N extends java.lang.Number> |
diff(Expression<? extends N> x,
N y)
Create an expression that returns the difference
between its arguments.
|
<N extends java.lang.Number> |
diff(N x,
Expression<? extends N> y)
Create an expression that returns the difference
between its arguments.
|
Predicate |
disjunction()
Create a disjunction (with zero disjuncts).
|
Predicate |
equal(Expression<?> x,
Expression<?> y)
Create a predicate for testing the arguments for equality.
|
Predicate |
equal(Expression<?> x,
java.lang.Object y)
Create a predicate for testing the arguments for equality.
|
Predicate |
exists(Subquery<?> subquery)
Create a predicate testing the existence of a subquery result.
|
Expression<java.lang.Double> |
exp(Expression<? extends java.lang.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.
|
<N extends java.lang.Number> |
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.
|
<T> Expression<T> |
function(java.lang.String name,
java.lang.Class<T> type,
Expression<?>... args)
Create an expression for the execution of a database
function.
|
Predicate |
ge(Expression<? extends java.lang.Number> x,
Expression<? extends java.lang.Number> y)
Create a predicate for testing whether the first argument is
greater than or equal to the second.
|
Predicate |
ge(Expression<? extends java.lang.Number> x,
java.lang.Number y)
Create a predicate for testing whether the first argument is
greater than or equal to the second.
|
<Y extends java.lang.Comparable<? super Y>> |
greaterThan(Expression<? extends Y> x,
Expression<? extends Y> y)
Create a predicate for testing whether the first argument is
greater than the second.
|
<Y extends java.lang.Comparable<? super Y>> |
greaterThan(Expression<? extends Y> x,
Y y)
Create a predicate for testing whether the first argument is
greater than the second.
|
<Y extends java.lang.Comparable<? super Y>> |
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.
|
<Y extends java.lang.Comparable<? super Y>> |
greaterThanOrEqualTo(Expression<? extends Y> x,
Y y)
Create a predicate for testing whether the first argument is
greater than or equal to the second.
|
<X extends java.lang.Comparable<? super X>> |
greatest(Expression<X> x)
Create an aggregate expression for finding the greatest of
the values (strings, dates, etc).
|
Predicate |
gt(Expression<? extends java.lang.Number> x,
Expression<? extends java.lang.Number> y)
Create a predicate for testing whether the first argument is
greater than the second.
|
Predicate |
gt(Expression<? extends java.lang.Number> x,
java.lang.Number y)
Create a predicate for testing whether the first argument is
greater than the second.
|
<T> CriteriaBuilder.In<T> |
in(Expression<? extends T> expression)
Create predicate to test whether given expression
is contained in a list of values.
|
<C extends java.util.Collection<?>> |
isEmpty(Expression<C> collection)
Create a predicate that tests whether a collection is empty.
|
Predicate |
isFalse(Expression<java.lang.Boolean> x)
Create a predicate testing for a false value.
|
<E,C extends java.util.Collection<E>> |
isMember(E elem,
Expression<C> collection)
Create a predicate that tests whether an element is
a member of a collection.
|
<E,C extends java.util.Collection<E>> |
isMember(Expression<E> elem,
Expression<C> collection)
Create a predicate that tests whether an element is
a member of a collection.
|
<C extends java.util.Collection<?>> |
isNotEmpty(Expression<C> collection)
Create a predicate that tests whether a collection is
not empty.
|
<E,C extends java.util.Collection<E>> |
isNotMember(E elem,
Expression<C> collection)
Create a predicate that tests whether an element is
not a member of a collection.
|
<E,C extends java.util.Collection<E>> |
isNotMember(Expression<E> elem,
Expression<C> collection)
Create a predicate that tests whether an element is
not a member of a collection.
|
Predicate |
isNotNull(Expression<?> x)
Create a predicate to test whether the expression is not null.
|
Predicate |
isNull(Expression<?> x)
Create a predicate to test whether the expression is null.
|
Predicate |
isTrue(Expression<java.lang.Boolean> x)
Create a predicate testing for a true value.
|
<K,M extends java.util.Map<K,?>> |
keys(M map)
Create an expression that returns the keys of a map.
|
Predicate |
le(Expression<? extends java.lang.Number> x,
Expression<? extends java.lang.Number> y)
Create a predicate for testing whether the first argument is
less than or equal to the second.
|
Predicate |
le(Expression<? extends java.lang.Number> x,
java.lang.Number y)
Create a predicate for testing whether the first argument is
less than or equal to the second.
|
<X extends java.lang.Comparable<? super X>> |
least(Expression<X> x)
Create an aggregate expression for finding the least of
the values (strings, dates, etc).
|
Expression<java.lang.Integer> |
length(Expression<java.lang.String> x)
Create expression to return length of a string.
|
<Y extends java.lang.Comparable<? super Y>> |
lessThan(Expression<? extends Y> x,
Expression<? extends Y> y)
Create a predicate for testing whether the first argument is
less than the second.
|
<Y extends java.lang.Comparable<? super Y>> |
lessThan(Expression<? extends Y> x,
Y y)
Create a predicate for testing whether the first argument is
less than the second.
|
<Y extends java.lang.Comparable<? super Y>> |
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.
|
<Y extends java.lang.Comparable<? super Y>> |
lessThanOrEqualTo(Expression<? extends Y> x,
Y y)
Create a predicate for testing whether the first argument is
less than or equal to the second.
|
Predicate |
like(Expression<java.lang.String> x,
Expression<java.lang.String> pattern)
Create a predicate for testing whether the expression
satisfies the given pattern.
|
Predicate |
like(Expression<java.lang.String> x,
Expression<java.lang.String> pattern,
char escapeChar)
Create a predicate for testing whether the expression
satisfies the given pattern.
|
Predicate |
like(Expression<java.lang.String> x,
Expression<java.lang.String> pattern,
Expression<java.lang.Character> escapeChar)
Create a predicate for testing whether the expression
satisfies the given pattern.
|
Predicate |
like(Expression<java.lang.String> x,
java.lang.String pattern)
Create a predicate for testing whether the expression
satisfies the given pattern.
|
Predicate |
like(Expression<java.lang.String> x,
java.lang.String pattern,
char escapeChar)
Create a predicate for testing whether the expression
satisfies the given pattern.
|
Predicate |
like(Expression<java.lang.String> x,
java.lang.String pattern,
Expression<java.lang.Character> escapeChar)
Create a predicate for testing whether the expression
satisfies the given pattern.
|
<T> Expression<T> |
literal(T value)
Create an expression for a literal.
|
Expression<java.lang.Double> |
ln(Expression<? extends java.lang.Number> x)
Create an expression that returns the natural logarithm
of its argument.
|
Expression<java.time.LocalDate> |
localDate()
Create expression to return current local date.
|
Expression<java.time.LocalDateTime> |
localDateTime()
Create expression to return current local datetime.
|
Expression<java.time.LocalTime> |
localTime()
Create expression to return current local time.
|
Expression<java.lang.Integer> |
locate(Expression<java.lang.String> x,
Expression<java.lang.String> pattern)
Create expression to locate the position of one string
within another, returning position of first character
if found.
|
Expression<java.lang.Integer> |
locate(Expression<java.lang.String> x,
Expression<java.lang.String> pattern,
Expression<java.lang.Integer> from)
Create expression to locate the position of one string
within another, returning position of first character
if found.
|
Expression<java.lang.Integer> |
locate(Expression<java.lang.String> x,
java.lang.String pattern)
Create expression to locate the position of one string
within another, returning position of first character
if found.
|
Expression<java.lang.Integer> |
locate(Expression<java.lang.String> x,
java.lang.String pattern,
int from)
Create expression to locate the position of one string
within another, returning position of first character
if found.
|
Expression<java.lang.String> |
lower(Expression<java.lang.String> x)
Create expression for converting a string to lowercase.
|
Predicate |
lt(Expression<? extends java.lang.Number> x,
Expression<? extends java.lang.Number> y)
Create a predicate for testing whether the first argument is
less than the second.
|
Predicate |
lt(Expression<? extends java.lang.Number> x,
java.lang.Number y)
Create a predicate for testing whether the first argument is
less than the second.
|
<N extends java.lang.Number> |
max(Expression<N> x)
Create an aggregate expression applying the numerical max
operation.
|
<N extends java.lang.Number> |
min(Expression<N> x)
Create an aggregate expression applying the numerical min
operation.
|
Expression<java.lang.Integer> |
mod(Expression<java.lang.Integer> x,
Expression<java.lang.Integer> y)
Create an expression that returns the modulus
(remainder under integer division) of its
arguments.
|
Expression<java.lang.Integer> |
mod(Expression<java.lang.Integer> x,
java.lang.Integer y)
Create an expression that returns the modulus
(remainder under integer division) of its
arguments.
|
Expression<java.lang.Integer> |
mod(java.lang.Integer x,
Expression<java.lang.Integer> y)
Create an expression that returns the modulus
(remainder under integer division) of its
arguments.
|
<N extends java.lang.Number> |
neg(Expression<N> x)
Create an expression that returns the arithmetic negation
of its argument.
|
Predicate |
not(Expression<java.lang.Boolean> restriction)
Create a negation of the given restriction.
|
Predicate |
notEqual(Expression<?> x,
Expression<?> y)
Create a predicate for testing the arguments for inequality.
|
Predicate |
notEqual(Expression<?> x,
java.lang.Object y)
Create a predicate for testing the arguments for inequality.
|
Predicate |
notLike(Expression<java.lang.String> x,
Expression<java.lang.String> pattern)
Create a predicate for testing whether the expression
does not satisfy the given pattern.
|
Predicate |
notLike(Expression<java.lang.String> x,
Expression<java.lang.String> pattern,
char escapeChar)
Create a predicate for testing whether the expression
does not satisfy the given pattern.
|
Predicate |
notLike(Expression<java.lang.String> x,
Expression<java.lang.String> pattern,
Expression<java.lang.Character> escapeChar)
Create a predicate for testing whether the expression
does not satisfy the given pattern.
|
Predicate |
notLike(Expression<java.lang.String> x,
java.lang.String pattern)
Create a predicate for testing whether the expression
does not satisfy the given pattern.
|
Predicate |
notLike(Expression<java.lang.String> x,
java.lang.String pattern,
char escapeChar)
Create a predicate for testing whether the expression
does not satisfy the given pattern.
|
Predicate |
notLike(Expression<java.lang.String> x,
java.lang.String pattern,
Expression<java.lang.Character> escapeChar)
Create a predicate for testing whether the expression
does not satisfy the given pattern.
|
<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.
|
<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.
|
<T> Expression<T> |
nullLiteral(java.lang.Class<T> resultClass)
Create an expression for a null literal with the given type.
|
Predicate |
or(Expression<java.lang.Boolean> x,
Expression<java.lang.Boolean> y)
Create a disjunction of the given boolean expressions.
|
Predicate |
or(Predicate... restrictions)
Create a disjunction of the given restriction predicates.
|
<T> ParameterExpression<T> |
parameter(java.lang.Class<T> paramClass)
Create a parameter expression.
|
<T> ParameterExpression<T> |
parameter(java.lang.Class<T> paramClass,
java.lang.String name)
Create a parameter expression with the given name.
|
Expression<java.lang.Double> |
power(Expression<? extends java.lang.Number> x,
Expression<? extends java.lang.Number> y)
Create an expression that returns the first argument
raised to the power of its second argument.
|
Expression<java.lang.Double> |
power(Expression<? extends java.lang.Number> x,
java.lang.Number y)
Create an expression that returns the first argument
raised to the power of its second argument.
|
<N extends java.lang.Number> |
prod(Expression<? extends N> x,
Expression<? extends N> y)
Create an expression that returns the product
of its arguments.
|
<N extends java.lang.Number> |
prod(Expression<? extends N> x,
N y)
Create an expression that returns the product
of its arguments.
|
<N extends java.lang.Number> |
prod(N x,
Expression<? extends N> y)
Create an expression that returns the product
of its arguments.
|
Expression<java.lang.Number> |
quot(Expression<? extends java.lang.Number> x,
Expression<? extends java.lang.Number> y)
Create an expression that returns the quotient
of its arguments.
|
Expression<java.lang.Number> |
quot(Expression<? extends java.lang.Number> x,
java.lang.Number y)
Create an expression that returns the quotient
of its arguments.
|
Expression<java.lang.Number> |
quot(java.lang.Number x,
Expression<? extends java.lang.Number> y)
Create an expression that returns the quotient
of its arguments.
|
<T extends java.lang.Number> |
round(Expression<T> x,
java.lang.Integer n)
Create an expression that returns the first argument
rounded to the number of decimal places given by the
second argument.
|
<R> CriteriaBuilder.Case<R> |
selectCase()
Create a general case expression.
|
<C,R> CriteriaBuilder.SimpleCase<C,R> |
selectCase(Expression<? extends C> expression)
Create a simple case expression.
|
Expression<java.lang.Integer> |
sign(Expression<? extends java.lang.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. |
<C extends java.util.Collection<?>> |
size(C collection)
Create an expression that tests the size of a collection.
|
<C extends java.util.Collection<?>> |
size(Expression<C> collection)
Create an expression that tests the size of a collection.
|
<Y> Expression<Y> |
some(Subquery<Y> subquery)
Create a some expression over the subquery results.
|
Expression<java.lang.Double> |
sqrt(Expression<? extends java.lang.Number> x)
Create an expression that returns the square root
of its argument.
|
Expression<java.lang.String> |
substring(Expression<java.lang.String> x,
Expression<java.lang.Integer> from)
Create an expression for substring extraction.
|
Expression<java.lang.String> |
substring(Expression<java.lang.String> x,
Expression<java.lang.Integer> from,
Expression<java.lang.Integer> len)
Create an expression for substring extraction.
|
Expression<java.lang.String> |
substring(Expression<java.lang.String> x,
int from)
Create an expression for substring extraction.
|
Expression<java.lang.String> |
substring(Expression<java.lang.String> x,
int from,
int len)
Create an expression for substring extraction.
|
<N extends java.lang.Number> |
sum(Expression<? extends N> x,
Expression<? extends N> y)
Create an expression that returns the sum
of its arguments.
|
<N extends java.lang.Number> |
sum(Expression<? extends N> x,
N y)
Create an expression that returns the sum
of its arguments.
|
<N extends java.lang.Number> |
sum(Expression<N> x)
Create an aggregate expression applying the sum operation.
|
<N extends java.lang.Number> |
sum(N x,
Expression<? extends N> y)
Create an expression that returns the sum
of its arguments.
|
Expression<java.lang.Double> |
sumAsDouble(Expression<java.lang.Float> x)
Create an aggregate expression applying the sum operation to a
Float-valued expression, returning a Double result.
|
Expression<java.lang.Long> |
sumAsLong(Expression<java.lang.Integer> x)
Create an aggregate expression applying the sum operation to an
Integer-valued expression, returning a Long result.
|
Expression<java.math.BigDecimal> |
toBigDecimal(Expression<? extends java.lang.Number> number)
Typecast.
|
Expression<java.math.BigInteger> |
toBigInteger(Expression<? extends java.lang.Number> number)
Typecast.
|
Expression<java.lang.Double> |
toDouble(Expression<? extends java.lang.Number> number)
Typecast.
|
Expression<java.lang.Float> |
toFloat(Expression<? extends java.lang.Number> number)
Typecast.
|
Expression<java.lang.Integer> |
toInteger(Expression<? extends java.lang.Number> number)
Typecast.
|
Expression<java.lang.Long> |
toLong(Expression<? extends java.lang.Number> number)
Typecast.
|
Expression<java.lang.String> |
toString(Expression<java.lang.Character> character)
Typecast.
|
<X,T,E extends T> |
treat(CollectionJoin<X,T> join,
java.lang.Class<E> type)
Downcast CollectionJoin object to the specified type.
|
<X,T,V extends T> |
treat(Join<X,T> join,
java.lang.Class<V> type)
Downcast Join object to the specified type.
|
<X,T,E extends T> |
treat(ListJoin<X,T> join,
java.lang.Class<E> type)
Downcast ListJoin object to the specified type.
|
<X,K,T,V extends T> |
treat(MapJoin<X,K,T> join,
java.lang.Class<V> type)
Downcast MapJoin object to the specified type.
|
<X,T extends X> |
treat(Path<X> path,
java.lang.Class<T> type)
Downcast Path object to the specified type.
|
<X,T extends X> |
treat(Root<X> root,
java.lang.Class<T> type)
Downcast Root object to the specified type.
|
<X,T,E extends T> |
treat(SetJoin<X,T> join,
java.lang.Class<E> type)
Downcast SetJoin object to the specified type.
|
Expression<java.lang.String> |
trim(char t,
Expression<java.lang.String> x)
Create expression to trim character from both ends of
a string.
|
Expression<java.lang.String> |
trim(CriteriaBuilder.Trimspec ts,
char t,
Expression<java.lang.String> x)
Create expression to trim character from a string.
|
Expression<java.lang.String> |
trim(CriteriaBuilder.Trimspec ts,
Expression<java.lang.Character> t,
Expression<java.lang.String> x)
Create expression to trim character from a string.
|
Expression<java.lang.String> |
trim(CriteriaBuilder.Trimspec ts,
Expression<java.lang.String> x)
Create expression to trim blanks from a string.
|
Expression<java.lang.String> |
trim(Expression<java.lang.Character> t,
Expression<java.lang.String> x)
Create expression to trim character from both ends of
a string.
|
Expression<java.lang.String> |
trim(Expression<java.lang.String> x)
Create expression to trim blanks from both ends of
a string.
|
CompoundSelection<Tuple> |
tuple(Selection<?>... selections)
Create a tuple-valued selection item.
|
Expression<java.lang.String> |
upper(Expression<java.lang.String> x)
Create expression for converting a string to uppercase.
|
<V,M extends java.util.Map<?,V>> |
values(M map)
Create an expression that returns the values of a map.
|
CriteriaQuery<java.lang.Object> createQuery()
CriteriaQuery
object.<T> CriteriaQuery<T> createQuery(java.lang.Class<T> resultClass)
CriteriaQuery
object with the specified result
type.resultClass
- type of the query resultCriteriaQuery<Tuple> createTupleQuery()
CriteriaQuery
object that returns a tuple of
objects as its result.<T> CriteriaUpdate<T> createCriteriaUpdate(java.lang.Class<T> targetEntity)
CriteriaUpdate
query object to perform a bulk update operation.targetEntity
- target type for update operation<T> CriteriaDelete<T> createCriteriaDelete(java.lang.Class<T> targetEntity)
CriteriaDelete
query object to perform a bulk delete operation.targetEntity
- target type for delete operation<Y> CompoundSelection<Y> construct(java.lang.Class<Y> resultClass, Selection<?>... selections)
resultClass
- class whose instance is to be constructedselections
- arguments to the constructorjava.lang.IllegalArgumentException
- if an argument is a
tuple- or array-valued selection itemCompoundSelection<Tuple> tuple(Selection<?>... selections)
selections
- selection itemsjava.lang.IllegalArgumentException
- if an argument is a
tuple- or array-valued selection itemCompoundSelection<java.lang.Object[]> array(Selection<?>... selections)
selections
- selection itemsjava.lang.IllegalArgumentException
- if an argument is a
tuple- or array-valued selection itemOrder asc(Expression<?> x)
x
- expression used to define the orderingOrder desc(Expression<?> x)
x
- expression used to define the ordering<N extends java.lang.Number> Expression<java.lang.Double> avg(Expression<N> x)
x
- expression representing input value to avg operation<N extends java.lang.Number> Expression<N> sum(Expression<N> x)
x
- expression representing input value to sum operationExpression<java.lang.Long> sumAsLong(Expression<java.lang.Integer> x)
x
- expression representing input value to sum operationExpression<java.lang.Double> sumAsDouble(Expression<java.lang.Float> x)
x
- expression representing input value to sum operation<N extends java.lang.Number> Expression<N> max(Expression<N> x)
x
- expression representing input value to max operation<N extends java.lang.Number> Expression<N> min(Expression<N> x)
x
- expression representing input value to min operation<X extends java.lang.Comparable<? super X>> Expression<X> greatest(Expression<X> x)
x
- expression representing input value to greatest
operation<X extends java.lang.Comparable<? super X>> Expression<X> least(Expression<X> x)
x
- expression representing input value to least
operationExpression<java.lang.Long> count(Expression<?> x)
x
- expression representing input value to count
operationExpression<java.lang.Long> countDistinct(Expression<?> x)
x
- expression representing input value to
count distinct operationPredicate exists(Subquery<?> subquery)
subquery
- subquery whose result is to be tested<Y> Expression<Y> all(Subquery<Y> subquery)
subquery
- subquery<Y> Expression<Y> some(Subquery<Y> subquery)
any
expression.subquery
- subquery<Y> Expression<Y> any(Subquery<Y> subquery)
some
expression.subquery
- subqueryPredicate and(Expression<java.lang.Boolean> x, Expression<java.lang.Boolean> y)
x
- boolean expressiony
- boolean expressionPredicate and(Predicate... restrictions)
restrictions
- zero or more restriction predicatesPredicate or(Expression<java.lang.Boolean> x, Expression<java.lang.Boolean> y)
x
- boolean expressiony
- boolean expressionPredicate or(Predicate... restrictions)
restrictions
- zero or more restriction predicatesPredicate not(Expression<java.lang.Boolean> restriction)
restriction
- restriction expressionPredicate conjunction()
Predicate disjunction()
Predicate isTrue(Expression<java.lang.Boolean> x)
x
- expression to be testedPredicate isFalse(Expression<java.lang.Boolean> x)
x
- expression to be testedPredicate isNull(Expression<?> x)
x
- expressionPredicate isNotNull(Expression<?> x)
x
- expressionPredicate equal(Expression<?> x, Expression<?> y)
x
- expressiony
- expressionPredicate equal(Expression<?> x, java.lang.Object y)
x
- expressiony
- objectPredicate notEqual(Expression<?> x, Expression<?> y)
x
- expressiony
- expressionPredicate notEqual(Expression<?> x, java.lang.Object y)
x
- expressiony
- object<Y extends java.lang.Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x, Expression<? extends Y> y)
x
- expressiony
- expression<Y extends java.lang.Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x, Y y)
x
- expressiony
- value<Y extends java.lang.Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y)
x
- expressiony
- expression<Y extends java.lang.Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x, Y y)
x
- expressiony
- value<Y extends java.lang.Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x, Expression<? extends Y> y)
x
- expressiony
- expression<Y extends java.lang.Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x, Y y)
x
- expressiony
- value<Y extends java.lang.Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y)
x
- expressiony
- expression<Y extends java.lang.Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x, Y y)
x
- expressiony
- value<Y extends java.lang.Comparable<? super Y>> Predicate between(Expression<? extends Y> v, Expression<? extends Y> x, Expression<? extends Y> y)
v
- expressionx
- expressiony
- expression<Y extends java.lang.Comparable<? super Y>> Predicate between(Expression<? extends Y> v, Y x, Y y)
v
- expressionx
- valuey
- valuePredicate gt(Expression<? extends java.lang.Number> x, Expression<? extends java.lang.Number> y)
x
- expressiony
- expressionPredicate gt(Expression<? extends java.lang.Number> x, java.lang.Number y)
x
- expressiony
- valuePredicate ge(Expression<? extends java.lang.Number> x, Expression<? extends java.lang.Number> y)
x
- expressiony
- expressionPredicate ge(Expression<? extends java.lang.Number> x, java.lang.Number y)
x
- expressiony
- valuePredicate lt(Expression<? extends java.lang.Number> x, Expression<? extends java.lang.Number> y)
x
- expressiony
- expressionPredicate lt(Expression<? extends java.lang.Number> x, java.lang.Number y)
x
- expressiony
- valuePredicate le(Expression<? extends java.lang.Number> x, Expression<? extends java.lang.Number> y)
x
- expressiony
- expressionPredicate le(Expression<? extends java.lang.Number> x, java.lang.Number y)
x
- expressiony
- valueExpression<java.lang.Integer> sign(Expression<? extends java.lang.Number> x)
1
if its argument is
positive, -1
if its argument is negative,
or 0
if its argument is exactly zero.x
- expression<N extends java.lang.Number> Expression<N> neg(Expression<N> x)
x
- expression<N extends java.lang.Number> Expression<N> abs(Expression<N> x)
x
- expression<N extends java.lang.Number> Expression<N> ceiling(Expression<N> x)
x
- expression<N extends java.lang.Number> Expression<N> floor(Expression<N> x)
x
- expression<N extends java.lang.Number> Expression<N> sum(Expression<? extends N> x, Expression<? extends N> y)
x
- expressiony
- expression<N extends java.lang.Number> Expression<N> sum(Expression<? extends N> x, N y)
x
- expressiony
- value<N extends java.lang.Number> Expression<N> sum(N x, Expression<? extends N> y)
x
- valuey
- expression<N extends java.lang.Number> Expression<N> prod(Expression<? extends N> x, Expression<? extends N> y)
x
- expressiony
- expression<N extends java.lang.Number> Expression<N> prod(Expression<? extends N> x, N y)
x
- expressiony
- value<N extends java.lang.Number> Expression<N> prod(N x, Expression<? extends N> y)
x
- valuey
- expression<N extends java.lang.Number> Expression<N> diff(Expression<? extends N> x, Expression<? extends N> y)
x
- expressiony
- expression<N extends java.lang.Number> Expression<N> diff(Expression<? extends N> x, N y)
x
- expressiony
- value<N extends java.lang.Number> Expression<N> diff(N x, Expression<? extends N> y)
x
- valuey
- expressionExpression<java.lang.Number> quot(Expression<? extends java.lang.Number> x, Expression<? extends java.lang.Number> y)
x
- expressiony
- expressionExpression<java.lang.Number> quot(Expression<? extends java.lang.Number> x, java.lang.Number y)
x
- expressiony
- valueExpression<java.lang.Number> quot(java.lang.Number x, Expression<? extends java.lang.Number> y)
x
- valuey
- expressionExpression<java.lang.Integer> mod(Expression<java.lang.Integer> x, Expression<java.lang.Integer> y)
x
- expressiony
- expressionExpression<java.lang.Integer> mod(Expression<java.lang.Integer> x, java.lang.Integer y)
x
- expressiony
- valueExpression<java.lang.Integer> mod(java.lang.Integer x, Expression<java.lang.Integer> y)
x
- valuey
- expressionExpression<java.lang.Double> sqrt(Expression<? extends java.lang.Number> x)
x
- expressionExpression<java.lang.Double> exp(Expression<? extends java.lang.Number> x)
x
- expressionExpression<java.lang.Double> ln(Expression<? extends java.lang.Number> x)
x
- expressionExpression<java.lang.Double> power(Expression<? extends java.lang.Number> x, Expression<? extends java.lang.Number> y)
x
- basey
- exponentExpression<java.lang.Double> power(Expression<? extends java.lang.Number> x, java.lang.Number y)
x
- basey
- exponent<T extends java.lang.Number> Expression<T> round(Expression<T> x, java.lang.Integer n)
x
- basen
- number of decimal placesExpression<java.lang.Long> toLong(Expression<? extends java.lang.Number> number)
number
- numeric expressionExpression<java.lang.Integer> toInteger(Expression<? extends java.lang.Number> number)
number
- numeric expressionExpression<java.lang.Float> toFloat(Expression<? extends java.lang.Number> number)
number
- numeric expressionExpression<java.lang.Double> toDouble(Expression<? extends java.lang.Number> number)
number
- numeric expressionExpression<java.math.BigDecimal> toBigDecimal(Expression<? extends java.lang.Number> number)
number
- numeric expressionExpression<java.math.BigInteger> toBigInteger(Expression<? extends java.lang.Number> number)
number
- numeric expressionExpression<java.lang.String> toString(Expression<java.lang.Character> character)
character
- expression<T> Expression<T> literal(T value)
value
- value represented by the expressionjava.lang.IllegalArgumentException
- if value is null<T> Expression<T> nullLiteral(java.lang.Class<T> resultClass)
resultClass
- type of the null literal<T> ParameterExpression<T> parameter(java.lang.Class<T> paramClass)
paramClass
- parameter class<T> ParameterExpression<T> parameter(java.lang.Class<T> paramClass, java.lang.String name)
paramClass
- parameter classname
- name that can be used to refer to
the parameter<C extends java.util.Collection<?>> Predicate isEmpty(Expression<C> collection)
collection
- expression<C extends java.util.Collection<?>> Predicate isNotEmpty(Expression<C> collection)
collection
- expression<C extends java.util.Collection<?>> Expression<java.lang.Integer> size(Expression<C> collection)
collection
- expression<C extends java.util.Collection<?>> Expression<java.lang.Integer> size(C collection)
collection
- collection<E,C extends java.util.Collection<E>> Predicate isMember(Expression<E> elem, Expression<C> collection)
elem
- element expressioncollection
- expression<E,C extends java.util.Collection<E>> Predicate isMember(E elem, Expression<C> collection)
elem
- elementcollection
- expression<E,C extends java.util.Collection<E>> Predicate isNotMember(Expression<E> elem, Expression<C> collection)
elem
- element expressioncollection
- expression<E,C extends java.util.Collection<E>> Predicate isNotMember(E elem, Expression<C> collection)
elem
- elementcollection
- expression<V,M extends java.util.Map<?,V>> Expression<java.util.Collection<V>> values(M map)
map
- map<K,M extends java.util.Map<K,?>> Expression<java.util.Set<K>> keys(M map)
map
- mapPredicate like(Expression<java.lang.String> x, Expression<java.lang.String> pattern)
x
- string expressionpattern
- string expressionPredicate like(Expression<java.lang.String> x, java.lang.String pattern)
x
- string expressionpattern
- stringPredicate like(Expression<java.lang.String> x, Expression<java.lang.String> pattern, Expression<java.lang.Character> escapeChar)
x
- string expressionpattern
- string expressionescapeChar
- escape character expressionPredicate like(Expression<java.lang.String> x, Expression<java.lang.String> pattern, char escapeChar)
x
- string expressionpattern
- string expressionescapeChar
- escape characterPredicate like(Expression<java.lang.String> x, java.lang.String pattern, Expression<java.lang.Character> escapeChar)
x
- string expressionpattern
- stringescapeChar
- escape character expressionPredicate like(Expression<java.lang.String> x, java.lang.String pattern, char escapeChar)
x
- string expressionpattern
- stringescapeChar
- escape characterPredicate notLike(Expression<java.lang.String> x, Expression<java.lang.String> pattern)
x
- string expressionpattern
- string expressionPredicate notLike(Expression<java.lang.String> x, java.lang.String pattern)
x
- string expressionpattern
- stringPredicate notLike(Expression<java.lang.String> x, Expression<java.lang.String> pattern, Expression<java.lang.Character> escapeChar)
x
- string expressionpattern
- string expressionescapeChar
- escape character expressionPredicate notLike(Expression<java.lang.String> x, Expression<java.lang.String> pattern, char escapeChar)
x
- string expressionpattern
- string expressionescapeChar
- escape characterPredicate notLike(Expression<java.lang.String> x, java.lang.String pattern, Expression<java.lang.Character> escapeChar)
x
- string expressionpattern
- stringescapeChar
- escape character expressionPredicate notLike(Expression<java.lang.String> x, java.lang.String pattern, char escapeChar)
x
- string expressionpattern
- stringescapeChar
- escape characterExpression<java.lang.String> concat(Expression<java.lang.String> x, Expression<java.lang.String> y)
x
- string expressiony
- string expressionExpression<java.lang.String> concat(Expression<java.lang.String> x, java.lang.String y)
x
- string expressiony
- stringExpression<java.lang.String> concat(java.lang.String x, Expression<java.lang.String> y)
x
- stringy
- string expressionExpression<java.lang.String> substring(Expression<java.lang.String> x, Expression<java.lang.Integer> from)
x
- string expressionfrom
- start position expressionExpression<java.lang.String> substring(Expression<java.lang.String> x, int from)
x
- string expressionfrom
- start positionExpression<java.lang.String> substring(Expression<java.lang.String> x, Expression<java.lang.Integer> from, Expression<java.lang.Integer> len)
x
- string expressionfrom
- start position expressionlen
- length expressionExpression<java.lang.String> substring(Expression<java.lang.String> x, int from, int len)
x
- string expressionfrom
- start positionlen
- lengthExpression<java.lang.String> trim(Expression<java.lang.String> x)
x
- expression for string to trimExpression<java.lang.String> trim(CriteriaBuilder.Trimspec ts, Expression<java.lang.String> x)
ts
- trim specificationx
- expression for string to trimExpression<java.lang.String> trim(Expression<java.lang.Character> t, Expression<java.lang.String> x)
t
- expression for character to be trimmedx
- expression for string to trimExpression<java.lang.String> trim(CriteriaBuilder.Trimspec ts, Expression<java.lang.Character> t, Expression<java.lang.String> x)
ts
- trim specificationt
- expression for character to be trimmedx
- expression for string to trimExpression<java.lang.String> trim(char t, Expression<java.lang.String> x)
t
- character to be trimmedx
- expression for string to trimExpression<java.lang.String> trim(CriteriaBuilder.Trimspec ts, char t, Expression<java.lang.String> x)
ts
- trim specificationt
- character to be trimmedx
- expression for string to trimExpression<java.lang.String> lower(Expression<java.lang.String> x)
x
- string expressionExpression<java.lang.String> upper(Expression<java.lang.String> x)
x
- string expressionExpression<java.lang.Integer> length(Expression<java.lang.String> x)
x
- string expressionExpression<java.lang.Integer> locate(Expression<java.lang.String> x, Expression<java.lang.String> pattern)
Warning: the order of the parameters of this method is reversed compared to the corresponding function in JPQL.
x
- expression for string to be searchedpattern
- expression for string to be locatedExpression<java.lang.Integer> locate(Expression<java.lang.String> x, java.lang.String pattern)
Warning: the order of the parameters of this method is reversed compared to the corresponding function in JPQL.
x
- expression for string to be searchedpattern
- string to be locatedExpression<java.lang.Integer> locate(Expression<java.lang.String> x, Expression<java.lang.String> pattern, Expression<java.lang.Integer> from)
Warning: the order of the first two parameters of this method is reversed compared to the corresponding function in JPQL.
x
- expression for string to be searchedpattern
- expression for string to be locatedfrom
- expression for position at which to start searchExpression<java.lang.Integer> locate(Expression<java.lang.String> x, java.lang.String pattern, int from)
Warning: the order of the first two parameters of this method is reversed compared to the corresponding function in JPQL.
x
- expression for string to be searchedpattern
- string to be locatedfrom
- position at which to start searchExpression<java.sql.Date> currentDate()
Expression<java.sql.Timestamp> currentTimestamp()
Expression<java.sql.Time> currentTime()
Expression<java.time.LocalDate> localDate()
Expression<java.time.LocalDateTime> localDateTime()
Expression<java.time.LocalTime> localTime()
<T> CriteriaBuilder.In<T> in(Expression<? extends T> expression)
expression
- to be tested against list of values<Y> Expression<Y> coalesce(Expression<? extends Y> x, Expression<? extends Y> y)
x
- expressiony
- expression<Y> Expression<Y> coalesce(Expression<? extends Y> x, Y y)
x
- expressiony
- value<Y> Expression<Y> nullif(Expression<Y> x, Expression<?> y)
x
- expressiony
- expression<Y> Expression<Y> nullif(Expression<Y> x, Y y)
x
- expressiony
- value<T> CriteriaBuilder.Coalesce<T> coalesce()
<C,R> CriteriaBuilder.SimpleCase<C,R> selectCase(Expression<? extends C> expression)
expression
- to be tested against the case conditions<R> CriteriaBuilder.Case<R> selectCase()
<T> Expression<T> function(java.lang.String name, java.lang.Class<T> type, Expression<?>... args)
name
- function nametype
- expected result typeargs
- function arguments<X,T,V extends T> Join<X,V> treat(Join<X,T> join, java.lang.Class<V> type)
join
- Join objecttype
- type to be downcast to<X,T,E extends T> CollectionJoin<X,E> treat(CollectionJoin<X,T> join, java.lang.Class<E> type)
join
- CollectionJoin objecttype
- type to be downcast to<X,T,E extends T> SetJoin<X,E> treat(SetJoin<X,T> join, java.lang.Class<E> type)
join
- SetJoin objecttype
- type to be downcast to<X,T,E extends T> ListJoin<X,E> treat(ListJoin<X,T> join, java.lang.Class<E> type)
join
- ListJoin objecttype
- type to be downcast to<X,K,T,V extends T> MapJoin<X,K,V> treat(MapJoin<X,K,T> join, java.lang.Class<V> type)
join
- MapJoin objecttype
- type to be downcast to<X,T extends X> Path<T> treat(Path<X> path, java.lang.Class<T> type)
path
- pathtype
- type to be downcast to