JPA Interface

CriteriaBuilder


Used to construct criteria queries, compound selections, expressions, predicates, orderings.

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.

Since:
JPA 2.0
The JPA Criteria API Queries article explains how to use CriteriaBuilder.

Public Methods

Create an expression that returns the absolute value of its argument.
Parameters:
x - expression
Return:
absolute value
Since:
JPA 2.0
Expression<Y> all(Subquery<Y> subquery)
Create an all expression over the subquery results.
Parameters:
subquery - subquery
Return:
all expression
Since:
JPA 2.0
Predicate and(Expression<Boolean> x, Expression<Boolean> y)
Create a conjunction of the given boolean expressions.
Parameters:
x - boolean expression
y - boolean expression
Return:
and predicate
Since:
JPA 2.0
Predicate and(Predicate... restrictions)
Create a conjunction of the given restriction predicates.
A conjunction of zero predicates is true.
Parameters:
restrictions - zero or more restriction predicates
Return:
and predicate
Since:
JPA 2.0
Expression<Y> any(Subquery<Y> subquery)
Create an any expression over the subquery results.
This expression is equivalent to a some expression.
Parameters:
subquery - subquery
Return:
any expression
Since:
JPA 2.0
CompoundSelection<Object[]> array(Selection<?>... selections)
Create an array-valued selection item.
Parameters:
selections - selection items
Return:
array-valued compound selection
Throws:
IllegalArgumentException - if an argument is a tuple- or array-valued selection item
Since:
JPA 2.0
Create an ordering by the ascending value of the expression.
Parameters:
x - expression used to define the ordering
Return:
ascending ordering corresponding to the expression
Since:
JPA 2.0
Expression<Double> avg(Expression<N> x)
Create an aggregate expression applying the avg operation.
Parameters:
x - expression representing input value to avg operation
Return:
avg expression
Since:
JPA 2.0
Predicate between(Expression<?extendsY> v, Expression<?extendsY> x, Expression<?extendsY> y)
Create a predicate for testing whether the first argument is between the second and third arguments in value.
Parameters:
v - expression
x - expression
y - expression
Return:
between predicate
Since:
JPA 2.0
Predicate between(Expression<?extendsY> v, Y x, Y y)
Create a predicate for testing whether the first argument is between the second and third arguments in value.
Parameters:
v - expression
x - value
y - value
Return:
between predicate
Since:
JPA 2.0
CriteriaBuilder.Coalesce<T> coalesce()
Create a coalesce expression.
Return:
coalesce expression
Since:
JPA 2.0
Expression<Y> coalesce(Expression<?extendsY> x, Expression<?extendsY> y)
Create an expression that returns null if all its arguments evaluate to null, and the value of the first non-null argument otherwise.
Parameters:
x - expression
y - expression
Return:
coalesce expression
Since:
JPA 2.0
Expression<Y> coalesce(Expression<?extendsY> 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.
Parameters:
x - expression
y - value
Return:
coalesce expression
Since:
JPA 2.0
Expression<String> concat(Expression<String> x, Expression<String> y)
Create an expression for string concatenation.
Parameters:
x - string expression
y - string expression
Return:
expression corresponding to concatenation
Since:
JPA 2.0
Expression<String> concat(Expression<String> x, String y)
Create an expression for string concatenation.
Parameters:
x - string expression
y - string
Return:
expression corresponding to concatenation
Since:
JPA 2.0
Expression<String> concat(String x, Expression<String> y)
Create an expression for string concatenation.
Parameters:
x - string
y - string expression
Return:
expression corresponding to concatenation
Since:
JPA 2.0
Create a conjunction (with zero conjuncts).
A conjunction with zero conjuncts is true.
Return:
and predicate
Since:
JPA 2.0
CompoundSelection<Y> construct(Class<Y> resultClass, Selection<?>... selections)
Create a selection item corresponding to a constructor.
This method is used to specify a constructor that will be applied to the results of the query execution. If the constructor is for an entity class, the resulting entities will be in the new state after the query is executed.
Parameters:
resultClass - class whose instance is to be constructed
selections - arguments to the constructor
Return:
compound selection item
Throws:
IllegalArgumentException - if an argument is a tuple- or array-valued selection item
Since:
JPA 2.0
Create an aggregate expression applying the count operation.
Parameters:
x - expression representing input value to count operation
Return:
count expression
Since:
JPA 2.0
Create an aggregate expression applying the count distinct operation.
Parameters:
x - expression representing input value to count distinct operation
Return:
count distinct expression
Since:
JPA 2.0
CriteriaDelete<T> createCriteriaDelete(Class<T> targetEntity)
Create a CriteriaDelete query object to perform a bulk delete operation.
Parameters:
targetEntity - target type for delete operation
Return:
the query object
Since:
JPA 2.1
CriteriaUpdate<T> createCriteriaUpdate(Class<T> targetEntity)
Create a CriteriaUpdate query object to perform a bulk update operation.
Parameters:
targetEntity - target type for update operation
Return:
the query object
Since:
JPA 2.1
Create a CriteriaQuery object.
Return:
criteria query object
Since:
JPA 2.0
CriteriaQuery<T> createQuery(Class<T> resultClass)
Create a CriteriaQuery object with the specified result type.
Parameters:
resultClass - type of the query result
Return:
criteria query object
Since:
JPA 2.0
Create a CriteriaQuery object that returns a tuple of objects as its result.
Return:
criteria query object
Since:
JPA 2.0
Create expression to return current date.
Return:
expression for current date
Since:
JPA 2.0
Create expression to return current time.
Return:
expression for current time
Since:
JPA 2.0
Create expression to return current timestamp.
Return:
expression for current timestamp
Since:
JPA 2.0
Create an ordering by the descending value of the expression.
Parameters:
x - expression used to define the ordering
Return:
descending ordering corresponding to the expression
Since:
JPA 2.0
Expression<N> diff(Expression<?extendsN> x, Expression<?extendsN> y)
Create an expression that returns the difference between its arguments.
Parameters:
x - expression
y - expression
Return:
difference
Since:
JPA 2.0
Expression<N> diff(Expression<?extendsN> x, N y)
Create an expression that returns the difference between its arguments.
Parameters:
x - expression
y - value
Return:
difference
Since:
JPA 2.0
Expression<N> diff(N x, Expression<?extendsN> y)
Create an expression that returns the difference between its arguments.
Parameters:
x - value
y - expression
Return:
difference
Since:
JPA 2.0
Create a disjunction (with zero disjuncts).
A disjunction with zero disjuncts is false.
Return:
or predicate
Since:
JPA 2.0
Create a predicate for testing the arguments for equality.
Parameters:
x - expression
y - expression
Return:
equality predicate
Since:
JPA 2.0
Predicate equal(Expression<?> x, Object y)
Create a predicate for testing the arguments for equality.
Parameters:
x - expression
y - object
Return:
equality predicate
Since:
JPA 2.0
Predicate exists(Subquery<?> subquery)
Create a predicate testing the existence of a subquery result.
Parameters:
subquery - subquery whose result is to be tested
Return:
exists predicate
Since:
JPA 2.0
Expression<T> function(String name, Class<T> type, Expression<?>... args)
Create an expression for the execution of a database function.
Parameters:
name - function name
type - expected result type
args - function arguments
Return:
expression
Since:
JPA 2.0
Predicate ge(Expression<?extendsNumber> x, Expression<?extendsNumber> y)
Create a predicate for testing whether the first argument is greater than or equal to the second.
Parameters:
x - expression
y - expression
Return:
greater-than-or-equal predicate
Since:
JPA 2.0
Predicate ge(Expression<?extendsNumber> x, Number y)
Create a predicate for testing whether the first argument is greater than or equal to the second.
Parameters:
x - expression
y - value
Return:
greater-than-or-equal predicate
Since:
JPA 2.0
Predicate greaterThan(Expression<?extendsY> x, Expression<?extendsY> y)
Create a predicate for testing whether the first argument is greater than the second.
Parameters:
x - expression
y - expression
Return:
greater-than predicate
Since:
JPA 2.0
Predicate greaterThan(Expression<?extendsY> x, Y y)
Create a predicate for testing whether the first argument is greater than the second.
Parameters:
x - expression
y - value
Return:
greater-than predicate
Since:
JPA 2.0
Predicate greaterThanOrEqualTo(Expression<?extendsY> x, Expression<?extendsY> y)
Create a predicate for testing whether the first argument is greater than or equal to the second.
Parameters:
x - expression
y - expression
Return:
greater-than-or-equal predicate
Since:
JPA 2.0
Create a predicate for testing whether the first argument is greater than or equal to the second.
Parameters:
x - expression
y - value
Return:
greater-than-or-equal predicate
Since:
JPA 2.0
Create an aggregate expression for finding the greatest of the values (strings, dates, etc).
Parameters:
x - expression representing input value to greatest operation
Return:
greatest expression
Since:
JPA 2.0
Predicate gt(Expression<?extendsNumber> x, Expression<?extendsNumber> y)
Create a predicate for testing whether the first argument is greater than the second.
Parameters:
x - expression
y - expression
Return:
greater-than predicate
Since:
JPA 2.0
Predicate gt(Expression<?extendsNumber> x, Number y)
Create a predicate for testing whether the first argument is greater than the second.
Parameters:
x - expression
y - value
Return:
greater-than predicate
Since:
JPA 2.0
CriteriaBuilder.In<T> in(Expression<?extendsT> expression)
Create predicate to test whether given expression is contained in a list of values.
Parameters:
expression - to be tested against list of values
Return:
in predicate
Since:
JPA 2.0
Predicate isEmpty(Expression<C> collection)
Create a predicate that tests whether a collection is empty.
Parameters:
collection - expression
Return:
is-empty predicate
Since:
JPA 2.0
Create a predicate testing for a false value.
Parameters:
x - expression to be tested
Return:
predicate
Since:
JPA 2.0
Predicate isMember(E elem, Expression<C> collection)
Create a predicate that tests whether an element is a member of a collection.
If the collection is empty, the predicate will be false.
Parameters:
elem - element
collection - expression
Return:
is-member predicate
Since:
JPA 2.0
Predicate isMember(Expression<E> elem, Expression<C> collection)
Create a predicate that tests whether an element is a member of a collection.
If the collection is empty, the predicate will be false.
Parameters:
elem - element expression
collection - expression
Return:
is-member predicate
Since:
JPA 2.0
Create a predicate that tests whether a collection is not empty.
Parameters:
collection - expression
Return:
is-not-empty predicate
Since:
JPA 2.0
Predicate isNotMember(E elem, Expression<C> collection)
Create a predicate that tests whether an element is not a member of a collection.
If the collection is empty, the predicate will be true.
Parameters:
elem - element
collection - expression
Return:
is-not-member predicate
Since:
JPA 2.0
Predicate isNotMember(Expression<E> elem, Expression<C> collection)
Create a predicate that tests whether an element is not a member of a collection.
If the collection is empty, the predicate will be true.
Parameters:
elem - element expression
collection - expression
Return:
is-not-member predicate
Since:
JPA 2.0
Create a predicate to test whether the expression is not null.
Parameters:
x - expression
Return:
is-not-null predicate
Since:
JPA 2.0
Create a predicate to test whether the expression is null.
Parameters:
x - expression
Return:
is-null predicate
Since:
JPA 2.0
Create a predicate testing for a true value.
Parameters:
x - expression to be tested
Return:
predicate
Since:
JPA 2.0
Expression<Set<K>> keys(M map)
Create an expression that returns the keys of a map.
Parameters:
map - map
Return:
set expression
Since:
JPA 2.0
Predicate le(Expression<?extendsNumber> x, Expression<?extendsNumber> y)
Create a predicate for testing whether the first argument is less than or equal to the second.
Parameters:
x - expression
y - expression
Return:
less-than-or-equal predicate
Since:
JPA 2.0
Predicate le(Expression<?extendsNumber> x, Number y)
Create a predicate for testing whether the first argument is less than or equal to the second.
Parameters:
x - expression
y - value
Return:
less-than-or-equal predicate
Since:
JPA 2.0
Create an aggregate expression for finding the least of the values (strings, dates, etc).
Parameters:
x - expression representing input value to least operation
Return:
least expression
Since:
JPA 2.0
Expression<Integer> length(Expression<String> x)
Create expression to return length of a string.
Parameters:
x - string expression
Return:
length expression
Since:
JPA 2.0
Predicate lessThan(Expression<?extendsY> x, Expression<?extendsY> y)
Create a predicate for testing whether the first argument is less than the second.
Parameters:
x - expression
y - expression
Return:
less-than predicate
Since:
JPA 2.0
Predicate lessThan(Expression<?extendsY> x, Y y)
Create a predicate for testing whether the first argument is less than the second.
Parameters:
x - expression
y - value
Return:
less-than predicate
Since:
JPA 2.0
Predicate lessThanOrEqualTo(Expression<?extendsY> x, Expression<?extendsY> y)
Create a predicate for testing whether the first argument is less than or equal to the second.
Parameters:
x - expression
y - expression
Return:
less-than-or-equal predicate
Since:
JPA 2.0
Predicate lessThanOrEqualTo(Expression<?extendsY> x, Y y)
Create a predicate for testing whether the first argument is less than or equal to the second.
Parameters:
x - expression
y - value
Return:
less-than-or-equal predicate
Since:
JPA 2.0
Predicate like(Expression<String> x, Expression<String> pattern)
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string expression
Return:
like predicate
Since:
JPA 2.0
Predicate like(Expression<String> x, Expression<String> pattern, Expression<Character> escapeChar)
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string expression
escapeChar - escape character expression
Return:
like predicate
Since:
JPA 2.0
Predicate like(Expression<String> x, Expression<String> pattern, char escapeChar)
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string expression
escapeChar - escape character
Return:
like predicate
Since:
JPA 2.0
Predicate like(Expression<String> x, String pattern)
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string
Return:
like predicate
Since:
JPA 2.0
Predicate like(Expression<String> x, String pattern, Expression<Character> escapeChar)
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string
escapeChar - escape character expression
Return:
like predicate
Since:
JPA 2.0
Predicate like(Expression<String> x, String pattern, char escapeChar)
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string
escapeChar - escape character
Return:
like predicate
Since:
JPA 2.0
Expression<T> literal(T value)
Create an expression for a literal.
Parameters:
value - value represented by the expression
Return:
expression literal
Throws:
IllegalArgumentException - if value is null
Since:
JPA 2.0
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.
Parameters:
x - expression for string to be searched
pattern - expression for string to be located
Return:
expression corresponding to position
Since:
JPA 2.0
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.
Parameters:
x - expression for string to be searched
pattern - expression for string to be located
from - expression for position at which to start search
Return:
expression corresponding to position
Since:
JPA 2.0
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.
Parameters:
x - expression for string to be searched
pattern - string to be located
Return:
expression corresponding to position
Since:
JPA 2.0
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.
Parameters:
x - expression for string to be searched
pattern - string to be located
from - position at which to start search
Return:
expression corresponding to position
Since:
JPA 2.0
Expression<String> lower(Expression<String> x)
Create expression for converting a string to lowercase.
Parameters:
x - string expression
Return:
expression to convert to lowercase
Since:
JPA 2.0
Predicate lt(Expression<?extendsNumber> x, Expression<?extendsNumber> y)
Create a predicate for testing whether the first argument is less than the second.
Parameters:
x - expression
y - expression
Return:
less-than predicate
Since:
JPA 2.0
Predicate lt(Expression<?extendsNumber> x, Number y)
Create a predicate for testing whether the first argument is less than the second.
Parameters:
x - expression
y - value
Return:
less-than predicate
Since:
JPA 2.0
Create an aggregate expression applying the numerical max operation.
Parameters:
x - expression representing input value to max operation
Return:
max expression
Since:
JPA 2.0
Create an aggregate expression applying the numerical min operation.
Parameters:
x - expression representing input value to min operation
Return:
min expression
Since:
JPA 2.0
Expression<Integer> mod(Expression<Integer> x, Expression<Integer> y)
Create an expression that returns the modulus of its arguments.
Parameters:
x - expression
y - expression
Return:
modulus
Since:
JPA 2.0
Expression<Integer> mod(Expression<Integer> x, Integer y)
Create an expression that returns the modulus of its arguments.
Parameters:
x - expression
y - value
Return:
modulus
Since:
JPA 2.0
Expression<Integer> mod(Integer x, Expression<Integer> y)
Create an expression that returns the modulus of its arguments.
Parameters:
x - value
y - expression
Return:
modulus
Since:
JPA 2.0
Create an expression that returns the arithmetic negation of its argument.
Parameters:
x - expression
Return:
arithmetic negation
Since:
JPA 2.0
Predicate not(Expression<Boolean> restriction)
Create a negation of the given restriction.
Parameters:
restriction - restriction expression
Return:
not predicate
Since:
JPA 2.0
Create a predicate for testing the arguments for inequality.
Parameters:
x - expression
y - expression
Return:
inequality predicate
Since:
JPA 2.0
Predicate notEqual(Expression<?> x, Object y)
Create a predicate for testing the arguments for inequality.
Parameters:
x - expression
y - object
Return:
inequality predicate
Since:
JPA 2.0
Predicate notLike(Expression<String> x, Expression<String> pattern)
Create a predicate for testing whether the expression does not satisfy the given pattern.
Parameters:
x - string expression
pattern - string expression
Return:
not-like predicate
Since:
JPA 2.0
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.
Parameters:
x - string expression
pattern - string expression
escapeChar - escape character expression
Return:
not-like predicate
Since:
JPA 2.0
Predicate notLike(Expression<String> x, Expression<String> pattern, char escapeChar)
Create a predicate for testing whether the expression does not satisfy the given pattern.
Parameters:
x - string expression
pattern - string expression
escapeChar - escape character
Return:
not-like predicate
Since:
JPA 2.0
Predicate notLike(Expression<String> x, String pattern)
Create a predicate for testing whether the expression does not satisfy the given pattern.
Parameters:
x - string expression
pattern - string
Return:
not-like predicate
Since:
JPA 2.0
Predicate notLike(Expression<String> x, String pattern, Expression<Character> escapeChar)
Create a predicate for testing whether the expression does not satisfy the given pattern.
Parameters:
x - string expression
pattern - string
escapeChar - escape character expression
Return:
not-like predicate
Since:
JPA 2.0
Predicate notLike(Expression<String> x, String pattern, char escapeChar)
Create a predicate for testing whether the expression does not satisfy the given pattern.
Parameters:
x - string expression
pattern - string
escapeChar - escape character
Return:
not-like predicate
Since:
JPA 2.0
Expression<T> nullLiteral(Class<T> resultClass)
Create an expression for a null literal with the given type.
Parameters:
resultClass - type of the null literal
Return:
null expression literal
Since:
JPA 2.0
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.
Parameters:
x - expression
y - expression
Return:
nullif expression
Since:
JPA 2.0
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.
Parameters:
x - expression
y - value
Return:
nullif expression
Since:
JPA 2.0
Predicate or(Expression<Boolean> x, Expression<Boolean> y)
Create a disjunction of the given boolean expressions.
Parameters:
x - boolean expression
y - boolean expression
Return:
or predicate
Since:
JPA 2.0
Predicate or(Predicate... restrictions)
Create a disjunction of the given restriction predicates.
A disjunction of zero predicates is false.
Parameters:
restrictions - zero or more restriction predicates
Return:
or predicate
Since:
JPA 2.0
ParameterExpression<T> parameter(Class<T> paramClass)
Create a parameter expression.
Parameters:
paramClass - parameter class
Return:
parameter expression
Since:
JPA 2.0
ParameterExpression<T> parameter(Class<T> paramClass, String name)
Create a parameter expression with the given name.
Parameters:
paramClass - parameter class
name - name that can be used to refer to the parameter
Return:
parameter expression
Since:
JPA 2.0
Expression<N> prod(Expression<?extendsN> x, Expression<?extendsN> y)
Create an expression that returns the product of its arguments.
Parameters:
x - expression
y - expression
Return:
product
Since:
JPA 2.0
Expression<N> prod(Expression<?extendsN> x, N y)
Create an expression that returns the product of its arguments.
Parameters:
x - expression
y - value
Return:
product
Since:
JPA 2.0
Expression<N> prod(N x, Expression<?extendsN> y)
Create an expression that returns the product of its arguments.
Parameters:
x - value
y - expression
Return:
product
Since:
JPA 2.0
Expression<Number> quot(Expression<?extendsNumber> x, Expression<?extendsNumber> y)
Create an expression that returns the quotient of its arguments.
Parameters:
x - expression
y - expression
Return:
quotient
Since:
JPA 2.0
Expression<Number> quot(Expression<?extendsNumber> x, Number y)
Create an expression that returns the quotient of its arguments.
Parameters:
x - expression
y - value
Return:
quotient
Since:
JPA 2.0
Expression<Number> quot(Number x, Expression<?extendsNumber> y)
Create an expression that returns the quotient of its arguments.
Parameters:
x - value
y - expression
Return:
quotient
Since:
JPA 2.0
CriteriaBuilder.Case<R> selectCase()
Create a general case expression.
Return:
general case expression
Since:
JPA 2.0
CriteriaBuilder.SimpleCase<C,R> selectCase(Expression<?extendsC> expression)
Create a simple case expression.
Parameters:
expression - to be tested against the case conditions
Return:
simple case expression
Since:
JPA 2.0
Expression<Integer> size(C collection)
Create an expression that tests the size of a collection.
Parameters:
collection - collection
Return:
size expression
Since:
JPA 2.0
Expression<Integer> size(Expression<C> collection)
Create an expression that tests the size of a collection.
Parameters:
collection - expression
Return:
size expression
Since:
JPA 2.0
Expression<Y> some(Subquery<Y> subquery)
Create a some expression over the subquery results.
This expression is equivalent to an any expression.
Parameters:
subquery - subquery
Return:
some expression
Since:
JPA 2.0
Expression<Double> sqrt(Expression<?extendsNumber> x)
Create an expression that returns the square root of its argument.
Parameters:
x - expression
Return:
square root
Since:
JPA 2.0
Expression<String> substring(Expression<String> x, Expression<Integer> from)
Create an expression for substring extraction.
Extracts a substring starting at the specified position through to end of the string. First position is 1.
Parameters:
x - string expression
from - start position expression
Return:
expression corresponding to substring extraction
Since:
JPA 2.0
Expression<String> substring(Expression<String> x, Expression<Integer> from, Expression<Integer> len)
Create an expression for substring extraction.
Extracts a substring of given length starting at the specified position. First position is 1.
Parameters:
x - string expression
from - start position expression
len - length expression
Return:
expression corresponding to substring extraction
Since:
JPA 2.0
Expression<String> substring(Expression<String> x, int from)
Create an expression for substring extraction.
Extracts a substring starting at the specified position through to end of the string. First position is 1.
Parameters:
x - string expression
from - start position
Return:
expression corresponding to substring extraction
Since:
JPA 2.0
Expression<String> substring(Expression<String> x, int from, int len)
Create an expression for substring extraction.
Extracts a substring of given length starting at the specified position. First position is 1.
Parameters:
x - string expression
from - start position
len - length
Return:
expression corresponding to substring extraction
Since:
JPA 2.0
Expression<N> sum(Expression<?extendsN> x, Expression<?extendsN> y)
Create an expression that returns the sum of its arguments.
Parameters:
x - expression
y - expression
Return:
sum
Since:
JPA 2.0
Expression<N> sum(Expression<?extendsN> x, N y)
Create an expression that returns the sum of its arguments.
Parameters:
x - expression
y - value
Return:
sum
Since:
JPA 2.0
Create an aggregate expression applying the sum operation.
Parameters:
x - expression representing input value to sum operation
Return:
sum expression
Since:
JPA 2.0
Expression<N> sum(N x, Expression<?extendsN> y)
Create an expression that returns the sum of its arguments.
Parameters:
x - value
y - expression
Return:
sum
Since:
JPA 2.0
Expression<Double> sumAsDouble(Expression<Float> x)
Create an aggregate expression applying the sum operation to a Float-valued expression, returning a Double result.
Parameters:
x - expression representing input value to sum operation
Return:
sum expression
Since:
JPA 2.0
Expression<Long> sumAsLong(Expression<Integer> x)
Create an aggregate expression applying the sum operation to an Integer-valued expression, returning a Long result.
Parameters:
x - expression representing input value to sum operation
Return:
sum expression
Since:
JPA 2.0
Expression<BigDecimal> toBigDecimal(Expression<?extendsNumber> number)
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Return:
Expression<BigDecimal>
Since:
JPA 2.0
Expression<BigInteger> toBigInteger(Expression<?extendsNumber> number)
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Return:
Expression<BigInteger>
Since:
JPA 2.0
Expression<Double> toDouble(Expression<?extendsNumber> number)
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Return:
Expression<Double>
Since:
JPA 2.0
Expression<Float> toFloat(Expression<?extendsNumber> number)
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Return:
Expression<Float>
Since:
JPA 2.0
Expression<Integer> toInteger(Expression<?extendsNumber> number)
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Return:
Expression<Integer>
Since:
JPA 2.0
Expression<Long> toLong(Expression<?extendsNumber> number)
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Return:
Expression<Long>
Since:
JPA 2.0
Expression<String> toString(Expression<Character> character)
Typecast.
Returns same expression object.
Parameters:
character - expression
Return:
Expression<String>
Since:
JPA 2.0
CollectionJoin<X,E> treat(CollectionJoin<X,T> join, Class<E> type)
Downcast CollectionJoin object to the specified type.
Parameters:
join - CollectionJoin object
type - type to be downcast to
Return:
CollectionJoin object of the specified type
Since:
JPA 2.1
Join<X,V> treat(Join<X,T> join, Class<V> type)
Downcast Join object to the specified type.
Parameters:
join - Join object
type - type to be downcast to
Return:
Join object of the specified type
Since:
JPA 2.1
ListJoin<X,E> treat(ListJoin<X,T> join, Class<E> type)
Downcast ListJoin object to the specified type.
Parameters:
join - ListJoin object
type - type to be downcast to
Return:
ListJoin object of the specified type
Since:
JPA 2.1
MapJoin<X,K,V> treat(MapJoin<X,K,T> join, Class<V> type)
Downcast MapJoin object to the specified type.
Parameters:
join - MapJoin object
type - type to be downcast to
Return:
MapJoin object of the specified type
Since:
JPA 2.1
Path<T> treat(Path<X> path, Class<T> type)
Downcast Path object to the specified type.
Parameters:
path - path
type - type to be downcast to
Return:
Path object of the specified type
Since:
JPA 2.1
Root<T> treat(Root<X> root, Class<T> type)
Downcast Root object to the specified type.
Parameters:
root - root
type - type to be downcast to
Return:
Root object of the specified type
Since:
JPA 2.1
SetJoin<X,E> treat(SetJoin<X,T> join, Class<E> type)
Downcast SetJoin object to the specified type.
Parameters:
join - SetJoin object
type - type to be downcast to
Return:
SetJoin object of the specified type
Since:
JPA 2.1
Expression<String> trim(Expression<Character> t, Expression<String> x)
Create expression to trim character from both ends of a string.
Parameters:
t - expression for character to be trimmed
x - expression for string to trim
Return:
trim expression
Since:
JPA 2.0
Expression<String> trim(Expression<String> x)
Create expression to trim blanks from both ends of a string.
Parameters:
x - expression for string to trim
Return:
trim expression
Since:
JPA 2.0
Expression<String> trim(CriteriaBuilder.Trimspec ts, Expression<Character> t, Expression<String> x)
Create expression to trim character from a string.
Parameters:
ts - trim specification
t - expression for character to be trimmed
x - expression for string to trim
Return:
trim expression
Since:
JPA 2.0
Expression<String> trim(CriteriaBuilder.Trimspec ts, Expression<String> x)
Create expression to trim blanks from a string.
Parameters:
ts - trim specification
x - expression for string to trim
Return:
trim expression
Since:
JPA 2.0
Expression<String> trim(CriteriaBuilder.Trimspec ts, char t, Expression<String> x)
Create expression to trim character from a string.
Parameters:
ts - trim specification
t - character to be trimmed
x - expression for string to trim
Return:
trim expression
Since:
JPA 2.0
Expression<String> trim(char t, Expression<String> x)
Create expression to trim character from both ends of a string.
Parameters:
t - character to be trimmed
x - expression for string to trim
Return:
trim expression
Since:
JPA 2.0
CompoundSelection<Tuple> tuple(Selection<?>... selections)
Create a tuple-valued selection item.
Parameters:
selections - selection items
Return:
tuple-valued compound selection
Throws:
IllegalArgumentException - if an argument is a tuple- or array-valued selection item
Since:
JPA 2.0
Expression<String> upper(Expression<String> x)
Create expression for converting a string to uppercase.
Parameters:
x - string expression
Return:
expression to convert to uppercase
Since:
JPA 2.0
Expression<Collection<V>> values(M map)
Create an expression that returns the values of a map.
Parameters:
map - map
Return:
collection expression
Since:
JPA 2.0