|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExpressionFactory
The ExpressionFactory must be implemented by a particular runtime
to form Expression
s in its native query language.
Method Summary | ||
---|---|---|
Value |
abs(Value num)
Return a value representing the absolute value of the given one. |
|
Value |
add(Value num1,
Value num2)
Return a value representing the two values added together. |
|
Value |
all(Value target)
Return an expression representing the given condition. |
|
Expression |
and(Expression exp1,
Expression exp2)
Return the two expressions AND'd together. |
|
Value |
any(Value target)
Return an expression representing the given condition. |
|
Expression |
asExpression(Value bool)
Return the given value as an expression. |
|
Value |
avg(Value num)
Return the average of the given value for all matches. |
|
Expression |
bindKeyVariable(Value var,
Value map)
Bind the given variable to the key set of the given map value. |
|
Expression |
bindValueVariable(Value var,
Value map)
Bind the given variable to the value set of the given map value. |
|
Expression |
bindVariable(Value var,
Value coll)
Bind the given variable to the given collection value. |
|
Value |
cast(Value obj,
Class cls)
Cast the value to the given class. |
|
Value |
coalesceExpression(Value[] val)
Return a coalesce expression |
|
Value |
concat(Value str,
Value args)
Return a value representing the concatenation of the given target with the given args. |
|
Expression |
contains(Value coll,
Value arg)
Return an expression representing the given condition. |
|
Expression |
containsKey(Value map,
Value arg)
Return an expression representing the given condition. |
|
Expression |
containsValue(Value map,
Value arg)
Return an expression representing the given condition. |
|
Value |
count(Value obj)
Return the count of the given value for all matches. |
|
Value |
distinct(Value obj)
Return distinct values of the given value. |
|
Value |
divide(Value num1,
Value num2)
Return a value representing the first value divided by the first one. |
|
Expression |
emptyExpression()
Return a blank expression; this is used when the filter is empty. |
|
Expression |
endsWith(Value str1,
Value str2)
Return whether the first string ends with the second. |
|
Expression |
equal(Value v1,
Value v2)
Return an expression representing the given condition. |
|
Value |
generalCaseExpression(Expression[] exp,
Value val)
Return a general case expression |
|
|
getCurrentDate(Class<T> dateType)
Return a value representing the current date. |
|
|
getCurrentTime(Class<T> timeType)
Return a value representing the current time. |
|
|
getCurrentTimestamp(Class<T> timestampType)
Return a value representing the current timestamp. |
|
Value |
getKey(Value val)
Path navigation thru map key |
|
Value |
getMapValue(Value map,
Value arg)
Return an expression representing the given condition. |
|
Value |
getNull()
Return a value representing null. |
|
Value |
getObjectId(Value val)
Return the object id of the given value. |
|
Value |
getThis()
Return a value representing this . |
|
Expression |
greaterThan(Value v1,
Value v2)
Return an expression representing the given condition. |
|
Expression |
greaterThanEqual(Value v1,
Value v2)
Return an expression representing the given condition. |
|
Value |
index(Value target)
Return an index/position of the given value within a collection/map. |
|
Value |
indexOf(Value str,
Value args)
Return a value representing the indexOf (LOCATE in JPQL) function on the given target with the given args. |
|
Expression |
isEmpty(Value target)
Return an expression representing the given condition. |
|
Expression |
isInstance(Value obj,
Class c)
Return whether the first value is an instance of the given class. |
|
Expression |
isNotEmpty(Value target)
Return an expression representing the given condition. |
|
boolean |
isVerticalType(Value val)
Return true if the Value is a Type expression and the Type uses joined table strategy. |
|
Expression |
lessThan(Value v1,
Value v2)
Return an expression representing the given condition. |
|
Expression |
lessThanEqual(Value v1,
Value v2)
Return an expression representing the given condition. |
|
Value |
mapEntry(Value key,
Value val)
Return the map entry of the given value. |
|
Value |
mapKey(Value key,
Value val)
Return the map key of the given value |
|
Expression |
matches(Value str,
Value regexp,
String single,
String multi,
String escape)
Return whether the string matches the matching pattern. |
|
Value |
max(Value num)
Return the max of the given value for all matches. |
|
Value |
min(Value num)
Return the max of the given value for all matches. |
|
Value |
mod(Value num1,
Value num2)
Return a value representing the first value mod'd by the second one. |
|
Value |
multiply(Value num1,
Value num2)
Return a value representing the two values multiplied together. |
|
Value |
newAggregate(AggregateListener listener,
Value args)
Return the value of the given function. |
|
Arguments |
newArgumentList(Value... values)
Return a function argument list consisting of the given values, any of which may itself be an argument list. |
|
Arguments |
newArgumentList(Value arg1,
Value arg2)
Return a function argument list consisting of the given values, either of which may itself be an argument list. |
|
Value |
newBoundVariable(String name,
Class type)
This method will be called only once per variable bound in a contains clause, and the returned value will be reused
for any further instances of the variable in subexpression of the
filter string. |
|
Parameter |
newCollectionValuedParameter(Object name,
Class type)
Return a value representing a collection-valued parameter. |
|
Value |
newExtension(FilterListener listener,
Value target,
Value args)
Return the value of the given extension. |
|
Value |
newFunction(String functionName,
Class<?> resultType,
Value... args)
Return a value representing the given datastore function with the given arguments. |
|
Literal |
newLiteral(Object val,
int parseType)
Return a value representing the given constant, which will be a Number , String , or Boolean instance. |
|
Parameter |
newParameter(Object name,
Class type)
Return a value representing a parameter for the given value. |
|
Path |
newPath()
Return a value representing a path which will consist of a chain of 1 or more field names starting in the namespace of the candidate class. Example: parent.address.city |
|
Path |
newPath(Value val)
Return a value representing a path which will consist of a chain of 1 or more field names starting in the namespace of the given value. Example: var.address.city |
|
Subquery |
newSubquery(ClassMetaData candidate,
boolean subs,
String alias)
Return a subquery. |
|
Literal |
newTypeLiteral(Object val,
int parseType)
Return a value representing the given constant, which will be a Number , String , or Boolean instance. |
|
Value |
newUnboundVariable(String name,
Class type)
Return an unbound variable. |
|
Expression |
not(Expression exp)
Return the inverse of this expression. |
|
Expression |
notEqual(Value v1,
Value v2)
Return an expression representing the given condition. |
|
Expression |
notMatches(Value str,
Value regexp,
String single,
String multi,
String escape)
Return whether the string does not match the given pattern. |
|
Value |
nullIfExpression(Value val1,
Value val2)
Return a nullif expression |
|
Expression |
or(Expression exp1,
Expression exp2)
Return the two expressions OR'd together. |
|
Value |
simpleCaseExpression(Value caseOperand,
Expression[] exp,
Value val)
Return a simple case expression |
|
Value |
size(Value target)
Return an expression representing the given condition. |
|
Value |
sqrt(Value num)
Return the square root of the given value. |
|
Expression |
startsWith(Value str1,
Value str2)
Return whether the first string starts with the second. |
|
Value |
stringLength(Value str)
Returns the number of characters in the String value. |
|
Value |
substring(Value str,
Value args)
Return a value representing the substring function on the given target with the given args. |
|
Value |
subtract(Value num1,
Value num2)
Return a value representing the second value subtracted from the first. |
|
Value |
sum(Value num)
Return the max of the given value for all matches. |
|
Value |
toLowerCase(Value str)
Return the upper case of the given value. |
|
Value |
toUpperCase(Value str)
Return the upper case of the given value. |
|
Value |
trim(Value str,
Value trimChar,
Boolean where)
Trims the specified specified trimChar from the specified value. |
|
Value |
type(Value target)
Return the type/class of the given value. |
|
Expression |
whenCondition(Expression exp,
Value val)
Return a when condidional clause |
|
Expression |
whenScalar(Value val1,
Value val2)
Return a when scalar_expression clause |
Method Detail |
---|
Expression emptyExpression()
Expression asExpression(Value bool)
Expression equal(Value v1, Value v2)
Expression notEqual(Value v1, Value v2)
Expression lessThan(Value v1, Value v2)
Expression greaterThan(Value v1, Value v2)
Expression lessThanEqual(Value v1, Value v2)
Expression greaterThanEqual(Value v1, Value v2)
Expression isEmpty(Value target)
Expression isNotEmpty(Value target)
Expression contains(Value coll, Value arg)
Expression containsKey(Value map, Value arg)
Expression containsValue(Value map, Value arg)
Value getMapValue(Value map, Value arg)
Expression isInstance(Value obj, Class c)
Expression and(Expression exp1, Expression exp2)
Expression or(Expression exp1, Expression exp2)
Expression not(Expression exp)
Expression bindVariable(Value var, Value coll)
Expression bindKeyVariable(Value var, Value map)
Expression bindValueVariable(Value var, Value map)
Expression endsWith(Value str1, Value str2)
Expression matches(Value str, Value regexp, String single, String multi, String escape)
str
- the value to compareregexp
- the pattern against which to comparesingle
- the token that signifies a single-character matchmulti
- the token that signifies a multi-character matchescape
- the escape token that escapes the matching tokensExpression notMatches(Value str, Value regexp, String single, String multi, String escape)
str
- the value to compareregexp
- the pattern against which to comparesingle
- the token that signifies a single-character matchmulti
- the token that signifies a multi-character matchescape
- the escape token that escapes the matching tokensExpression startsWith(Value str1, Value str2)
Value stringLength(Value str)
Value trim(Value str, Value trimChar, Boolean where)
str
- the value from which to trimtrimChar
- the characters to trim offwhere
- which side of the String to trim: null
indicates both sides, true indicates
leading, and false indicates trailingSubquery newSubquery(ClassMetaData candidate, boolean subs, String alias)
newPath(Value)
, passing in the subquery as the
value.
candidate
- the candidate class of the subquerysubs
- whether the query includes subclassesalias
- the alias given to the query candidate classPath newPath()
parent.address.city
Path newPath(Value val)
var.address.city
Literal newLiteral(Object val, int parseType)
Number
, String
, or Boolean
instance.
Value getThis()
this
.
Value getNull()
<T extends Date> Value getCurrentDate(Class<T> dateType)
<T extends Date> Value getCurrentTime(Class<T> timeType)
<T extends Date> Value getCurrentTimestamp(Class<T> timestampType)
Parameter newParameter(Object name, Class type)
Object
if the parameter is not declared.
Parameter newCollectionValuedParameter(Object name, Class type)
Object
if the parameter is not declared.
Value newExtension(FilterListener listener, Value target, Value args)
Value newAggregate(AggregateListener listener, Value args)
Arguments newArgumentList(Value arg1, Value arg2)
Arguments newArgumentList(Value... values)
Value newUnboundVariable(String name, Class type)
Object
if the variable is not declared.
Value newBoundVariable(String name, Class type)
contains
clause, and the returned value will be reused
for any further instances of the variable in subexpression of the
filter string. The type may be Object
if the variable is
not declared.
Value cast(Value obj, Class cls)
Value add(Value num1, Value num2)
Value subtract(Value num1, Value num2)
Value multiply(Value num1, Value num2)
Value divide(Value num1, Value num2)
Value mod(Value num1, Value num2)
Value abs(Value num)
Value indexOf(Value str, Value args)
Value concat(Value str, Value args)
Value sqrt(Value num)
Value substring(Value str, Value args)
String.substring(int)
,
the start index is one-based, and the second argument is the length.
Value toUpperCase(Value str)
Value toLowerCase(Value str)
Value avg(Value num)
Value count(Value obj)
Value max(Value num)
Value min(Value num)
Value sum(Value num)
Value any(Value target)
Value all(Value target)
Value size(Value target)
Value index(Value target)
Value type(Value target)
Value mapEntry(Value key, Value val)
Value mapKey(Value key, Value val)
Value getKey(Value val)
Value distinct(Value obj)
Value getObjectId(Value val)
Value simpleCaseExpression(Value caseOperand, Expression[] exp, Value val)
Value generalCaseExpression(Expression[] exp, Value val)
Expression whenCondition(Expression exp, Value val)
Expression whenScalar(Value val1, Value val2)
Value coalesceExpression(Value[] val)
Value nullIfExpression(Value val1, Value val2)
Literal newTypeLiteral(Object val, int parseType)
Number
, String
, or Boolean
instance.
Value newFunction(String functionName, Class<?> resultType, Value... args)
boolean isVerticalType(Value val)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |