Jakarta Persistence (JPA) Interface

jakarta.persistence.criteria.CriteriaBuilder


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

Note that Predicate is used instead of Expression in this API in order to work around the fact that Java generics are not compatible with varags.

Since:
Jakarta Persistence (JPA) 2.0
The JPA Criteria API Queries article explains how to use CriteriaBuilder.

Public Instance Methods

Create an expression that returns the absolute value of its argument.
Parameters:
x - expression
Returns:
absolute value.
Since:
Jakarta Persistence (JPA) 1.0
Create an all expression over the subquery results.
Parameters:
subquery - subquery
Returns:
all expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a conjunction of the given boolean expressions.
Parameters:
x - boolean expression
y - boolean expression
Returns:
and predicate.
Since:
Jakarta Persistence (JPA) 1.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
Returns:
and predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a conjunction of the given restriction predicates.
A conjunction of zero predicates is true.
Parameters:
restrictions - a list of zero or more restriction predicates
Returns:
and predicate.
Since:
Jakarta Persistence (JPA) 3.2
Create an any expression over the subquery results.
This expression is equivalent to a some expression.
Parameters:
subquery - subquery
Returns:
any expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an array-valued selection item.
Parameters:
selections - selection items
Returns:
array-valued compound selection.
Throws:
IllegalArgumentException - if an argument is a tuple- or array-valued selection item.
Since:
Jakarta Persistence (JPA) 1.0
Create an array-valued selection item.
Parameters:
selections - list of selection items
Returns:
array-valued compound selection.
Throws:
IllegalArgumentException - if an argument is a tuple- or array-valued selection item.
Since:
Jakarta Persistence (JPA) 3.2
Order asc(Expression<?> expression)
Create an ordering by the ascending value of the expression.
Parameters:
expression - expression used to define the ordering
Returns:
ascending ordering corresponding to the expression.
Since:
Jakarta Persistence (JPA) 1.0
Order asc(Expression<?> expression, Nulls nullPrecedence)
Create an ordering by the ascending value of the expression.
Parameters:
expression - expression used to define the ordering
nullPrecedence - the precedence of null values
Returns:
ascending ordering corresponding to the expression.
Since:
Jakarta Persistence (JPA) 3.2
Create an aggregate expression applying the avg operation.
Parameters:
x - expression representing input value to avg operation
Returns:
avg expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is between the second and third arguments in value.
Parameters:
x - expression
y - expression
v - expression
Returns:
between predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is between the second and third arguments in value.
Parameters:
x - value
y - value
v - expression
Returns:
between predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the ceiling of its argument, that is, the smallest integer greater than or equal to its argument.
Parameters:
x - expression
Returns:
ceiling.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
coalesce expression.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
coalesce expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a coalesce expression.
Returns:
coalesce expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression for string concatenation.
If the given list of expressions is empty, returns an expression equivalent to literal("").
Parameters:
expressions - string expressions
Returns:
expression corresponding to concatenation.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression for string concatenation.
Parameters:
x - string expression
y - string expression
Returns:
expression corresponding to concatenation.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression for string concatenation.
Parameters:
x - string expression
y - string
Returns:
expression corresponding to concatenation.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression for string concatenation.
Parameters:
x - string
y - string expression
Returns:
expression corresponding to concatenation.
Since:
Jakarta Persistence (JPA) 1.0
Create a conjunction (with zero conjuncts).
A conjunction with zero conjuncts is true.
Returns:
and predicate.
Since:
Jakarta Persistence (JPA) 1.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 is 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:
selections - arguments to the constructor
resultClass - class whose instance is to be constructed
Returns:
compound selection item.
Throws:
IllegalArgumentException - if an argument is a tuple- or array-valued selection item.
Since:
Jakarta Persistence (JPA) 1.0
Create an aggregate expression applying the count operation.
Parameters:
x - expression representing input value to count operation
Returns:
count expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an aggregate expression applying the count distinct operation.
Parameters:
x - expression representing input value to count distinct operation
Returns:
count distinct expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a CriteriaDelete<T> query object to perform a bulk delete operation.
Parameters:
targetEntity - target type for delete operation
Returns:
the query object.
Since:
Jakarta Persistence (JPA) 2.1
Create a CriteriaUpdate<T> query object to perform a bulk update operation.
Parameters:
targetEntity - target type for update operation
Returns:
the query object.
Since:
Jakarta Persistence (JPA) 2.1
Create a CriteriaQuery<T> object.
Returns:
criteria query object.
Since:
Jakarta Persistence (JPA) 1.0
CriteriaQuery<T> createQuery(Class<T> resultClass)
Create a CriteriaQuery<T> object with the given result type.
Parameters:
resultClass - type of the query result
Returns:
criteria query object.
Since:
Jakarta Persistence (JPA) 1.0
Create a CriteriaQuery<T> object that returns a tuple of objects as its result.
Returns:
criteria query object.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to return current date.
Returns:
expression for current date.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to return current time.
Returns:
expression for current time.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to return current timestamp.
Returns:
expression for current timestamp.
Since:
Jakarta Persistence (JPA) 1.0
Create an ordering by the descending value of the expression.
Parameters:
expression - expression used to define the ordering
Returns:
descending ordering corresponding to the expression.
Since:
Jakarta Persistence (JPA) 1.0
Order desc(Expression<?> expression, Nulls nullPrecedence)
Create an ordering by the descending value of the expression.
Parameters:
expression - expression used to define the ordering
nullPrecedence - the precedence of null values
Returns:
descending ordering corresponding to the expression.
Since:
Jakarta Persistence (JPA) 3.2
Create an expression that returns the difference between its arguments.
Parameters:
x - expression
y - expression
Returns:
difference.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the difference between its arguments.
Parameters:
x - expression
y - value
Returns:
difference.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the difference between its arguments.
Parameters:
x - value
y - expression
Returns:
difference.
Since:
Jakarta Persistence (JPA) 1.0
Create a disjunction (with zero disjuncts).
A disjunction with zero disjuncts is false.
Returns:
or predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing the arguments for equality.
Parameters:
x - expression
y - expression
Returns:
equality predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing the arguments for equality.
Parameters:
x - expression
y - object
Returns:
equality predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a query by (setwise) subtraction of the second query from the first query.
Returns:
a new criteria query which returns the result of subtracting the results of the second query from the results of the first query.
Since:
Jakarta Persistence (JPA) 3.2
Create a query by (setwise) subtraction of the second query from the first query, without elimination of duplicate results.
Returns:
a new criteria query which returns the result of subtracting the results of the second query from the results of the first query.
Since:
Jakarta Persistence (JPA) 3.2
Create a predicate testing the existence of a subquery result.
Parameters:
subquery - subquery whose result is to be tested
Returns:
exists predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the exponential of its argument, that is, Euler's number e raised to the power of its argument.
Parameters:
x - expression
Returns:
exponential.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the value of a field extracted from a date, time, or datetime.
Parameters:
field - a temporal field type
temporal - a date, time, or datetime
Returns:
expression for the value of the extracted field.
Since:
Jakarta Persistence (JPA) 3.2
Create an expression that returns the floor of its argument, that is, the largest integer smaller than or equal to its argument.
Parameters:
x - expression
Returns:
floor.
Since:
Jakarta Persistence (JPA) 1.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
args - function arguments
type - expected result type
Returns:
expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is greater than or equal to the second.
Parameters:
x - expression
y - expression
Returns:
greater-than-or-equal predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is greater than or equal to the second.
Parameters:
x - expression
y - value
Returns:
greater-than-or-equal predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is greater than the second.
Parameters:
x - expression
y - expression
Returns:
greater-than predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is greater than the second.
Parameters:
x - expression
y - value
Returns:
greater-than predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is greater than or equal to the second.
Parameters:
x - expression
y - expression
Returns:
greater-than-or-equal predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is greater than or equal to the second.
Parameters:
x - expression
y - value
Returns:
greater-than-or-equal predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create an aggregate expression for finding the greatest of the values (strings, dates, etc).
Parameters:
x - expression representing input value to greatest operation
Returns:
greatest expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is greater than the second.
Parameters:
x - expression
y - expression
Returns:
greater-than predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is greater than the second.
Parameters:
x - expression
y - value
Returns:
greater-than predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create predicate to test whether given expression is contained in a list of values.
Parameters:
expression - to be tested against list of values
Returns:
in predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a query which is the intersection of the given queries.
Returns:
a new criteria query which returns the intersection of the results of the given queries.
Since:
Jakarta Persistence (JPA) 3.2
Create a query which is the intersection of the given queries, without elimination of duplicate results.
Returns:
a new criteria query which returns the intersection of the results of the given queries.
Since:
Jakarta Persistence (JPA) 3.2
Create a predicate that tests whether a collection is empty.
Parameters:
collection - expression
Returns:
is-empty predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate testing for a false value.
Parameters:
x - expression to be tested
Returns:
predicate.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
is-member predicate.
Since:
Jakarta Persistence (JPA) 1.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
Returns:
is-member predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate that tests whether a collection is not empty.
Parameters:
collection - expression
Returns:
is-not-empty predicate.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
is-not-member predicate.
Since:
Jakarta Persistence (JPA) 1.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
Returns:
is-not-member predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate to test whether the expression is not null.
Parameters:
x - expression
Returns:
is-not-null predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate to test whether the expression is null.
Parameters:
x - expression
Returns:
is-null predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate testing for a true value.
Parameters:
x - expression to be tested
Returns:
predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the keys of a map.
Parameters:
map - map
Returns:
set expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is less than or equal to the second.
Parameters:
x - expression
y - expression
Returns:
less-than-or-equal predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is less than or equal to the second.
Parameters:
x - expression
y - value
Returns:
less-than-or-equal predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create an aggregate expression for finding the least of the values (strings, dates, etc).
Parameters:
x - expression representing input value to least operation
Returns:
least expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression for the leftmost substring of a string,
Parameters:
x - string expression
len - length of the substring to return
Returns:
expression for the leftmost substring.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression for the leftmost substring of a string,
Parameters:
x - string expression
len - length of the substring to return
Returns:
expression for the leftmost substring.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to return length of a string.
Parameters:
x - string expression
Returns:
length expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is less than the second.
Parameters:
x - expression
y - expression
Returns:
less-than predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is less than the second.
Parameters:
x - expression
y - value
Returns:
less-than predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is less than or equal to the second.
Parameters:
x - expression
y - expression
Returns:
less-than-or-equal predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is less than or equal to the second.
Parameters:
x - expression
y - value
Returns:
less-than-or-equal predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string expression
Returns:
like predicate.
Since:
Jakarta Persistence (JPA) 1.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
Returns:
like predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string expression
escapeChar - escape character expression
Returns:
like predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string expression
escapeChar - escape character
Returns:
like predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the expression satisfies the given pattern.
Parameters:
x - string expression
pattern - string
escapeChar - escape character expression
Returns:
like predicate.
Since:
Jakarta Persistence (JPA) 1.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
Returns:
like predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression for a literal.
Parameters:
value - value represented by the expression
Returns:
expression literal.
Throws:
IllegalArgumentException - if value is null.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the natural logarithm of its argument.
Parameters:
x - expression
Returns:
natural logarithm.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to return current local date.
Returns:
expression for current date.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to return current local datetime.
Returns:
expression for current timestamp.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to return current local time.
Returns:
expression for current time.
Since:
Jakarta Persistence (JPA) 1.0
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.

Warning: the order of the parameters of this method is reversed compared to the corresponding function in JPQL.

Parameters:
x - expression for string to be searched
pattern - expression for string to be located
Returns:
expression corresponding to position.
Since:
Jakarta Persistence (JPA) 1.0
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.

Warning: the order of the parameters of this method is reversed compared to the corresponding function in JPQL.

Parameters:
x - expression for string to be searched
pattern - string to be located
Returns:
expression corresponding to position.
Since:
Jakarta Persistence (JPA) 1.0
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.

Warning: the order of the first two parameters of this method is reversed compared to the corresponding function in JPQL.

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.
Since:
Jakarta Persistence (JPA) 1.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.

Warning: the order of the first two parameters of this method is reversed compared to the corresponding function in JPQL.

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.
Since:
Jakarta Persistence (JPA) 1.0
Create expression for converting a string to lowercase.
Parameters:
x - string expression
Returns:
expression to convert to lowercase.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is less than the second.
Parameters:
x - expression
y - expression
Returns:
less-than predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the first argument is less than the second.
Parameters:
x - expression
y - value
Returns:
less-than predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create an aggregate expression applying the numerical max operation.
Parameters:
x - expression representing input value to max operation
Returns:
max expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an aggregate expression applying the numerical min operation.
Parameters:
x - expression representing input value to min operation
Returns:
min expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the modulus (remainder under integer division) of its arguments.
Parameters:
x - expression
y - expression
Returns:
modulus.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the modulus (remainder under integer division) of its arguments.
Parameters:
x - expression
y - value
Returns:
modulus.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the modulus (remainder under integer division) of its arguments.
Parameters:
x - value
y - expression
Returns:
modulus.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the arithmetic negation of its argument.
Parameters:
x - expression
Returns:
arithmetic negation.
Since:
Jakarta Persistence (JPA) 1.0
Create a negation of the given restriction.
Parameters:
restriction - restriction expression
Returns:
not predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing the arguments for inequality.
Parameters:
x - expression
y - expression
Returns:
inequality predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing the arguments for inequality.
Parameters:
x - expression
y - object
Returns:
inequality predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the expression does not satisfy the given pattern.
Parameters:
x - string expression
pattern - string expression
Returns:
not-like predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the expression does not satisfy the given pattern.
Parameters:
x - string expression
pattern - string
Returns:
not-like predicate.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
not-like predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the expression does not satisfy the given pattern.
Parameters:
x - string expression
pattern - string expression
escapeChar - escape character
Returns:
not-like predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a predicate for testing whether the expression does not satisfy the given pattern.
Parameters:
x - string expression
pattern - string
escapeChar - escape character expression
Returns:
not-like predicate.
Since:
Jakarta Persistence (JPA) 1.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
Returns:
not-like predicate.
Since:
Jakarta Persistence (JPA) 1.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
Returns:
null expression literal.
Since:
Jakarta Persistence (JPA) 1.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
Returns:
nullif expression.
Since:
Jakarta Persistence (JPA) 1.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 - value
Returns:
nullif expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a disjunction of the given boolean expressions.
Parameters:
x - boolean expression
y - boolean expression
Returns:
or predicate.
Since:
Jakarta Persistence (JPA) 1.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
Returns:
or predicate.
Since:
Jakarta Persistence (JPA) 1.0
Create a disjunction of the given restriction predicates.
A disjunction of zero predicates is false.
Parameters:
restrictions - a list of zero or more restriction predicates
Returns:
or predicate.
Since:
Jakarta Persistence (JPA) 3.2
ParameterExpression<T> parameter(Class<T> paramClass)
Create a parameter expression.
Parameters:
paramClass - parameter class
Returns:
parameter expression.
Since:
Jakarta Persistence (JPA) 1.0
ParameterExpression<T> parameter(Class<T> paramClass, String name)
Create a parameter expression with the given name.
Parameters:
name - name that can be used to refer to the parameter
paramClass - parameter class
Returns:
parameter expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the first argument raised to the power of its second argument.
Parameters:
x - base
y - exponent
Returns:
the base raised to the power of the exponent.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the first argument raised to the power of its second argument.
Parameters:
x - base
y - exponent
Returns:
the base raised to the power of the exponent.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the product of its arguments.
Parameters:
x - expression
y - expression
Returns:
product.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the product of its arguments.
Parameters:
x - expression
y - value
Returns:
product.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the product of its arguments.
Parameters:
x - value
y - expression
Returns:
product.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the quotient of its arguments.
Parameters:
x - expression
y - expression
Returns:
quotient.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the quotient of its arguments.
Parameters:
x - expression
y - value
Returns:
quotient.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the quotient of its arguments.
Parameters:
x - value
y - expression
Returns:
quotient.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression replacing every occurrence of a substring within a string.
Parameters:
x - string expression
replacement - the replacement string
substring - the literal substring to replace
Returns:
expression for the resulting string.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression replacing every occurrence of a substring within a string.
Parameters:
x - string expression
replacement - the replacement string
substring - the literal substring to replace
Returns:
expression for the resulting string.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression replacing every occurrence of a substring within a string.
Parameters:
x - string expression
replacement - the replacement string
substring - the literal substring to replace
Returns:
expression for the resulting string.
Since:
Jakarta Persistence (JPA) 1.0
Expression<String> replace(Expression<String> x, String substring, String replacement)
Create an expression replacing every occurrence of a substring within a string.
Parameters:
x - string expression
replacement - the replacement string
substring - the literal substring to replace
Returns:
expression for the resulting string.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression for the rightmost substring of a string,
Parameters:
x - string expression
len - length of the substring to return
Returns:
expression for the rightmost substring.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression for the rightmost substring of a string,
Parameters:
x - string expression
len - length of the substring to return
Returns:
expression for the rightmost substring.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the first argument rounded to the number of decimal places given by the second argument.
Parameters:
x - base
n - number of decimal places
Returns:
the rounded value.
Since:
Jakarta Persistence (JPA) 1.0
Create a simple case expression.
Parameters:
expression - to be tested against the case conditions
Returns:
simple case expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a general case expression.
Returns:
general case expression.
Since:
Jakarta Persistence (JPA) 1.0
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.
Parameters:
x - expression
Returns:
sign.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that tests the size of a collection.
Parameters:
collection - expression
Returns:
size expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that tests the size of a collection.
Parameters:
collection - collection
Returns:
size expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a some expression over the subquery results.
This expression is equivalent to an any expression.
Parameters:
subquery - subquery
Returns:
some expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the square root of its argument.
Parameters:
x - expression
Returns:
square root.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
expression corresponding to substring extraction.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
expression corresponding to substring extraction.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
expression corresponding to substring extraction.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
expression corresponding to substring extraction.
Since:
Jakarta Persistence (JPA) 1.0
Create an aggregate expression applying the sum operation.
Parameters:
x - expression representing input value to sum operation
Returns:
sum expression.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the sum of its arguments.
Parameters:
x - expression
y - expression
Returns:
sum.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the sum of its arguments.
Parameters:
x - expression
y - value
Returns:
sum.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the sum of its arguments.
Parameters:
x - value
y - expression
Returns:
sum.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
sum expression.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
sum expression.
Since:
Jakarta Persistence (JPA) 1.0
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Returns:
Expression.
Since:
Jakarta Persistence (JPA) 1.0
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Returns:
Expression.
Since:
Jakarta Persistence (JPA) 1.0
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Returns:
Expression.
Since:
Jakarta Persistence (JPA) 1.0
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Returns:
Expression.
Since:
Jakarta Persistence (JPA) 1.0
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Returns:
Expression.
Since:
Jakarta Persistence (JPA) 1.0
Typecast.
Returns same expression object.
Parameters:
number - numeric expression
Returns:
Expression.
Since:
Jakarta Persistence (JPA) 1.0
Typecast.
Returns same expression object.
Parameters:
character - expression
Returns:
Expression.
Since:
Jakarta Persistence (JPA) 1.0
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
Returns:
Join object of the specified type.
Since:
Jakarta Persistence (JPA) 2.1
Downcast CollectionJoin object to the specified type.
Parameters:
join - CollectionJoin object
type - type to be downcast to
Returns:
CollectionJoin object of the specified type.
Since:
Jakarta Persistence (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
Returns:
SetJoin object of the specified type.
Since:
Jakarta Persistence (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
Returns:
ListJoin object of the specified type.
Since:
Jakarta Persistence (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
Returns:
MapJoin object of the specified type.
Since:
Jakarta Persistence (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
Returns:
Path object of the specified type.
Since:
Jakarta Persistence (JPA) 2.1
Root<T> treat(Root<X> root, Class<T> type)
Downcast Root object to the specified type.
Parameters:
type - type to be downcast to
root - root
Returns:
Root object of the specified type.
Since:
Jakarta Persistence (JPA) 2.1
Create expression to trim blanks from both ends of a string.
Parameters:
x - expression for string to trim
Returns:
trim expression.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to trim blanks from a string.
Parameters:
x - expression for string to trim
ts - trim specification
Returns:
trim expression.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to trim character from both ends of a string.
Parameters:
x - expression for string to trim
t - expression for character to be trimmed
Returns:
trim expression.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to trim character from a string.
Parameters:
x - expression for string to trim
t - expression for character to be trimmed
ts - trim specification
Returns:
trim expression.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to trim character from both ends of a string.
Parameters:
x - expression for string to trim
t - character to be trimmed
Returns:
trim expression.
Since:
Jakarta Persistence (JPA) 1.0
Create expression to trim character from a string.
Parameters:
x - expression for string to trim
t - character to be trimmed
ts - trim specification
Returns:
trim expression.
Since:
Jakarta Persistence (JPA) 1.0
Create a tuple-valued selection item.
Parameters:
selections - selection items
Returns:
tuple-valued compound selection.
Throws:
IllegalArgumentException - if an argument is a tuple- or array-valued selection item.
Since:
Jakarta Persistence (JPA) 1.0
Create a tuple-valued selection item.
Parameters:
selections - list of selection items
Returns:
tuple-valued compound selection.
Throws:
IllegalArgumentException - if an argument is a tuple- or array-valued selection item.
Since:
Jakarta Persistence (JPA) 3.2
Create a query which is the union of the given queries.
Returns:
a new criteria query which returns the union of the results of the given queries.
Since:
Jakarta Persistence (JPA) 3.2
Create a query which is the union of the given queries, without elimination of duplicate results.
Returns:
a new criteria query which returns the union of the results of the given queries.
Since:
Jakarta Persistence (JPA) 3.2
Create expression for converting a string to uppercase.
Parameters:
x - string expression
Returns:
expression to convert to uppercase.
Since:
Jakarta Persistence (JPA) 1.0
Create an expression that returns the values of a map.
Parameters:
map - map
Returns:
collection expression.
Since:
Jakarta Persistence (JPA) 1.0