Interface Expression
-
- All Superinterfaces:
OrderByItem
,PredicateOperand
,SelectItem
- All Known Subinterfaces:
Aggregate
,DomainObject
,PathExpression
- All Known Implementing Classes:
AbsExpression
,AbstractDomainObject
,ArrayExpression
,AverageExpression
,BinaryOperatorExpression
,ConcatExpression
,CountExpression
,CurrentTimeExpression
,DistinctExpression
,DividedByExpression
,ElseExpression
,EntryExpression
,FetchPath
,IndexExpression
,JoinPath
,KeyExpression
,LengthExpression
,LiteralExpression
,LocateExpression
,LowerExpression
,MaxExpression
,MinExpression
,MinusExpression
,OperatorPath
,ParameterExpression
,PlusExpression
,QueryDefinitionImpl
,RangeExpression
,RootPath
,SizeExpression
,SquareRootExpression
,SubStringExpression
,SumExpression
,TimesExpression
,TrimExpression
,TypeExpression
,UnaryMinusExpression
,UpperExpression
,ValueExpression
,VarArgsExpression
public interface Expression extends SelectItem, PredicateOperand
Instances of this interface can be used either as select list items or as predicate operands.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Expression
abs()
Absolute value.Expression
concat(java.lang.String... str)
Concatenate a string with other string(s).Expression
concat(Expression... str)
Concatenate a string with other string(s).Expression
dividedBy(java.lang.Number num)
Division.Expression
dividedBy(Expression expr)
Division.Predicate
in(java.lang.Class... classes)
Create a predicate for testing whether the expression value is a member of the argument list.Predicate
in(java.lang.Enum<?>... enums)
Create a predicate for testing whether the expression value is a member of the argument list.Predicate
in(java.lang.Number... nums)
Create a predicate for testing whether the expression value is a member of the argument list.Predicate
in(java.lang.String... strings)
Create a predicate for testing whether the expression value is a member of the argument list.Predicate
in(Expression... params)
Create a predicate for testing whether the expression value is a member of the argument list.Predicate
in(Subquery subquery)
Create a predicate for testing whether the expression value is a member of a subquery result.Predicate
isNull()
Create a predicate for testing whether the value of the expression is null.Expression
length()
String length This method must be invoked on an expression corresponding to a string.Expression
locate(java.lang.String str)
Locate a string contained within the string corresponding to the expression on which the method was invoked.Expression
locate(java.lang.String str, int position)
Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position.Expression
locate(java.lang.String str, Expression position)
Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position.Expression
locate(Expression str)
Locate a string contained within the string corresponding to the expression on which the method was invoked.Expression
locate(Expression str, int position)
Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position.Expression
locate(Expression str, Expression position)
Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position.Expression
lower()
Convert string to lowercase.Predicate
member(PathExpression arg)
Create a predicate for testing whether the expression is a member of the association or element collection denoted by the path expression.Expression
minus()
Unary minus.Expression
minus(java.lang.Number num)
Subtraction.Expression
minus(Expression expr)
Subtraction.Expression
mod(int num)
Modulo operation.Expression
mod(Expression expr)
Modulo operation.Expression
plus(java.lang.Number num)
Addition.Expression
plus(Expression expr)
Addition.Expression
sqrt()
Square root.Expression
substring(int start)
Extract a substring starting at specified position through to the end of the string.Expression
substring(int start, int len)
Extract a substring.Expression
substring(int start, Expression len)
Extract a substring.Expression
substring(Expression start)
Extract a substring starting at specified position through to the end of the string.Expression
substring(Expression start, int len)
Extract a substring.Expression
substring(Expression start, Expression len)
Extract a substring.Expression
times(java.lang.Number num)
Multiplication.Expression
times(Expression expr)
Multiplication.Expression
trim()
Trim leading and trailing blanks.Expression
trim(char c)
Trim leading and trailing occurrences of character from the string.Expression
trim(char c, TrimSpec spec)
Trim occurrences of the character from leading or trailing (or both) positions of the string, as specified by trim spec.Expression
trim(Expression expr)
Trim leading and trailing occurrences of character specified by the expression argument from the string.Expression
trim(Expression expr, TrimSpec spec)
Trim occurrences of the character specified by the expression argument from leading or trailing (or both) positions of the string, as specified by trim spec.Expression
trim(TrimSpec spec)
Trim leading, trailing blanks (or both) as specified by trim spec.Expression
upper()
Convert string to uppercase.-
Methods inherited from interface org.apache.openjpa.persistence.query.PredicateOperand
between, between, between, between, between, between, between, between, between, between, between, between, between, equal, equal, equal, equal, equal, equal, equal, equal, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, lessEqual, lessEqual, lessEqual, lessEqual, lessEqual, lessThan, lessThan, lessThan, lessThan, lessThan, like, like, like, like, like, like, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual
-
Methods inherited from interface org.apache.openjpa.persistence.query.SelectItem
asc, desc
-
-
-
-
Method Detail
-
member
Predicate member(PathExpression arg)
Create a predicate for testing whether the expression is a member of the association or element collection denoted by the path expression. The argument must correspond to a collection-valued association or element collection of like type.- Parameters:
arg
- - a path expression that specifies a collection-valued association or an element collection- Returns:
- conditional predicate
-
isNull
Predicate isNull()
Create a predicate for testing whether the value of the expression is null.- Returns:
- conditional predicate
-
in
Predicate in(java.lang.String... strings)
Create a predicate for testing whether the expression value is a member of the argument list.- Parameters:
strings
-- Returns:
- conditional predicate
-
in
Predicate in(java.lang.Number... nums)
Create a predicate for testing whether the expression value is a member of the argument list.- Parameters:
nums
-- Returns:
- conditional predicate
-
in
Predicate in(java.lang.Enum<?>... enums)
Create a predicate for testing whether the expression value is a member of the argument list.- Parameters:
enums
-- Returns:
- conditional predicate
-
in
Predicate in(java.lang.Class... classes)
Create a predicate for testing whether the expression value is a member of the argument list.- Parameters:
classes
-- Returns:
- conditional predicate
-
in
Predicate in(Expression... params)
Create a predicate for testing whether the expression value is a member of the argument list.- Parameters:
params
-- Returns:
- conditional predicate
-
in
Predicate in(Subquery subquery)
Create a predicate for testing whether the expression value is a member of a subquery result.- Parameters:
subquery
-- Returns:
- conditional predicate
-
length
Expression length()
String length This method must be invoked on an expression corresponding to a string.- Returns:
- expression denoting the length of the string.
-
concat
Expression concat(java.lang.String... str)
Concatenate a string with other string(s). This method must be invoked on an expression corresponding to a string.- Parameters:
str
- - string(s)- Returns:
- expression denoting the concatenation of the strings, starting with the string corresponding to the expression on which the method was invoked.
-
concat
Expression concat(Expression... str)
Concatenate a string with other string(s). This method must be invoked on an expression corresponding to a string.- Parameters:
str
- - expression(s) corresponding to string(s)- Returns:
- expression denoting the concatenation of the strings, starting with the string corresponding to the expression on which the method was invoked.
-
substring
Expression substring(int start)
Extract a substring starting at specified position through to the end of the string. This method must be invoked on an expression corresponding to a string.- Parameters:
start
- - start position (1 indicates first position)- Returns:
- expression denoting the extracted substring
-
substring
Expression substring(Expression start)
Extract a substring starting at specified position through to the end of the string. This method must be invoked on an expression corresponding to a string.- Parameters:
start
- - expression denoting start position (1 indicates first position)- Returns:
- expression denoting the extracted substring
-
substring
Expression substring(int start, int len)
Extract a substring. This method must be invoked on an expression corresponding to a string.- Parameters:
start
- - start position (1 indicates first position)len
- - length of the substring to be returned- Returns:
- expression denoting the extracted substring
-
substring
Expression substring(int start, Expression len)
Extract a substring. This method must be invoked on an expression corresponding to a string.- Parameters:
start
- - start position (1 indicates first position)len
- - expression denoting length of the substring to return- Returns:
- expression denoting the extracted substring
-
substring
Expression substring(Expression start, int len)
Extract a substring. This method must be invoked on an expression corresponding to a string.- Parameters:
start
- - expression denoting start position (1 indicates first position)len
- - length of the substring to return- Returns:
- expression denoting the extracted substring
-
substring
Expression substring(Expression start, Expression len)
Extract a substring. This method must be invoked on an expression corresponding to a string.- Parameters:
start
- - expression denoting start position (1 indicates first position)len
- - expression denoting length of the substring to return- Returns:
- expression denoting the extracted substring
-
lower
Expression lower()
Convert string to lowercase. This method must be invoked on an expression corresponding to a string.- Returns:
- expression denoting the string in lowercase
-
upper
Expression upper()
Convert string to uppercase. This method must be invoked on an expression corresponding to a string.- Returns:
- expression denoting the string in uppercase
-
trim
Expression trim()
Trim leading and trailing blanks. This method must be invoked on an expression corresponding to a string.- Returns:
- expression denoting trimmed string
-
trim
Expression trim(TrimSpec spec)
Trim leading, trailing blanks (or both) as specified by trim spec. This method must be invoked on an expression corresponding to a string.- Parameters:
spec
- - trim specification- Returns:
- expression denoting trimmed string
-
trim
Expression trim(char c)
Trim leading and trailing occurrences of character from the string. This method must be invoked on an expression corresponding to a string.- Parameters:
c
- - character to be trimmed- Returns:
- expression denoting trimmed string
-
trim
Expression trim(char c, TrimSpec spec)
Trim occurrences of the character from leading or trailing (or both) positions of the string, as specified by trim spec. This method must be invoked on an expression corresponding to a string.- Parameters:
c
- - character to be trimmedspec
- - trim specification- Returns:
- expression denoting trimmed string
-
trim
Expression trim(Expression expr)
Trim leading and trailing occurrences of character specified by the expression argument from the string. This method must be invoked on an expression corresponding to a string.- Parameters:
expr
- - expression corresponding to the character to be trimmed- Returns:
- expression denoting trimmed string
-
trim
Expression trim(Expression expr, TrimSpec spec)
Trim occurrences of the character specified by the expression argument from leading or trailing (or both) positions of the string, as specified by trim spec. This method must be invoked on an expression corresponding to a string.- Parameters:
expr
- - expression corresponding to the character to be trimmedspec
- - trim specification- Returns:
- expression denoting trimmed string
-
locate
Expression locate(java.lang.String str)
Locate a string contained within the string corresponding to the expression on which the method was invoked. The search is started at position 1 (first string position). This method must be invoked on an expression corresponding to a string.- Parameters:
str
- - string to be located- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
Expression locate(Expression str)
Locate a string contained within the string corresponding to the expression on which the method was invoked. The search is started at position 1 (first string position). This method must be invoked on an expression corresponding to a string.- Parameters:
str
- - expression corresponding to the string to be located- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
Expression locate(java.lang.String str, int position)
Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position. This method must be invoked on an expression corresponding to a string.- Parameters:
str
- - string to be locatedposition
- - position at which to start the search- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
Expression locate(java.lang.String str, Expression position)
Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position. This method must be invoked on an expression corresponding to a string.- Parameters:
str
- - string to be locatedposition
- - expression corresponding to position at which to start the search- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
Expression locate(Expression str, int position)
Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position. This method must be invoked on an expression corresponding to a string.- Parameters:
str
- - expression corresponding to the string to be locatedposition
- - position at which to start the search- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
locate
Expression locate(Expression str, Expression position)
Locate a string contained within the string corresponding to the expression on which the method was invoked, starting at a specified search position. This method must be invoked on an expression corresponding to a string.- Parameters:
str
- - expression corresponding to the string to be locatedposition
- - expression corresponding to position at which to start the search- Returns:
- expression denoting the first position at which the string was found or expression denoting 0 if the string was not found
-
plus
Expression plus(java.lang.Number num)
Addition. This method must be invoked on an expression corresponding to a number.- Parameters:
num
- - number to be added- Returns:
- expression denoting the sum
-
plus
Expression plus(Expression expr)
Addition. This method must be invoked on an expression corresponding to a number.- Parameters:
expr
- - expression corresponding to number to be added- Returns:
- expression denoting the sum
-
minus
Expression minus()
Unary minus. This method must be invoked on an expression corresponding to a number.- Returns:
- expression denoting the unary minus of the expression
-
minus
Expression minus(java.lang.Number num)
Subtraction. This method must be invoked on an expression corresponding to a number.- Parameters:
num
- - subtrahend- Returns:
- expression denoting the result of subtracting the argument from the number corresponding to the expression on which the method was invoked.
-
minus
Expression minus(Expression expr)
Subtraction. This method must be invoked on an expression corresponding to a number.- Parameters:
expr
- - expression corresponding to subtrahend- Returns:
- expression denoting the result of subtracting the number denoted by the argument from the number corresponding to the expression on which the method was invoked.
-
dividedBy
Expression dividedBy(java.lang.Number num)
Division. This method must be invoked on an expression corresponding to a number.- Parameters:
num
- - divisor- Returns:
- expression denoting the result of dividing the number corresponding to the expression on which the method was invoked by the argument
-
dividedBy
Expression dividedBy(Expression expr)
Division. This method must be invoked on an expression corresponding to a number.- Parameters:
expr
- - expression corresponding to the divisor- Returns:
- expression denoting the result of dividing the number corresponding to the expression on which the method was invoked by the number denoted by the argument
-
times
Expression times(java.lang.Number num)
Multiplication. This method must be invoked on an expression corresponding to a number.- Parameters:
num
- - multiplier- Returns:
- expression denoting the result of multiplying the argument with the number corresponding to the expression on which the method was invoked.
-
times
Expression times(Expression expr)
Multiplication. This method must be invoked on an expression corresponding to a number.- Parameters:
expr
- - expression corresponding to the multiplier- Returns:
- expression denoting the result of multiplying the number denoted by the argument with the number corresponding to the expression on which the method was invoked.
-
abs
Expression abs()
Absolute value. This method must be invoked on an expression corresponding to a number.- Returns:
- expression corresponding to the absolute value
-
sqrt
Expression sqrt()
Square root. This method must be invoked on an expression corresponding to a number.- Returns:
- expression corresponding to the square root
-
mod
Expression mod(int num)
Modulo operation. This must be invoked on an expression corresponding to an integer value- Parameters:
num
- - integer divisor- Returns:
- expression corresponding to the integer remainder of the division of the integer corresponding to the expression on which the method was invoked by the argument.
-
mod
Expression mod(Expression expr)
Modulo operation. This must be invoked on an expression corresponding to an integer value- Parameters:
expr
- - expression corresponding to integer divisor- Returns:
- expression corresponding to the integer remainder of the division of the integer corresponding to the expression on which the method was invoked by the argument.
-
-