Interface Exprs
Expression
building methods- Since:
- 14.0 - Caribou Lou
-
Method Summary
Modifier and TypeMethodDescriptionBuilds an expression computing the absolute value of the given value.abs
(BigDecimal e) Builds an expression computing the absolute value of the given value.abs
(Expression e) Builds an expression computing the absolute value of the given value.and
(Expression... exprs) Builds the logical conjunction of the given expressions.avg
(Expression e) Builds an expression computing the value of the aggregated average of a given expression.Builds a literal boolean expression.caseWhen
(Expression condition, Expression thenExpr, Expression elseExpr) Builds a conditional CASE WHEN expression.coalesce
(Expression... exprs) Builds an expression that will return the value of the first non-null resulting given expression.count()
Builds an expression computing the number of aggregated rows.count
(Expression e) Builds an expression computing the number of aggregated non-null values of the given expression.Builds a literal date expression from aDate
object ignoring all time related values.Builds a literal datetime expression from aDate
object.dateTime
(DateTime dateTime) Builds a literal datetime expression from aDateTime
object.Builds an expression computing the value of the exponential function applied to the given value.exp
(BigDecimal e) Builds an expression computing the value of the exponential function applied to the given value.exp
(Expression e) Builds an expression computing the value of the exponential function applied to the given value.Builds a literal integer expression.max
(Expression e) Builds an expression computing the value of the aggregated maximum of a given expression.min
(Expression e) Builds an expression computing the value of the aggregated minimum of a given expression.not
(Expression e) Builds the logical negation of the given expressionnullIf
(Expression... exprs) Builds an expression that will computes the standard SQL function NULLIF applied to the given expressions.or
(Expression... exprs) Builds the logical disjunction of the given expressions.real
(BigDecimal value) Builds a literal real expression.Builds a literal string expression.sum
(Expression e) Builds an expression computing the value of the aggregated sum of a given expression.
-
Method Details
-
and
Builds the logical conjunction of the given expressions.- Parameters:
exprs
- the expressions to be part of the conjunction- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
or
Builds the logical disjunction of the given expressions.- Parameters:
exprs
- the expressions to be part of the disjunction- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
not
Builds the logical negation of the given expression- Parameters:
e
- the expressions to be negated- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
abs
Builds an expression computing the absolute value of the given value.- Parameters:
e
- the value on which to apply the abs operator- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
abs
Builds an expression computing the absolute value of the given value.- Parameters:
e
- the value on which to apply the abs operator- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
abs
Builds an expression computing the absolute value of the given value.- Parameters:
e
- the value on which to apply the abs operator- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
exp
Builds an expression computing the value of the exponential function applied to the given value.- Parameters:
e
- the value on which to apply the exponential function- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
exp
Builds an expression computing the value of the exponential function applied to the given value.- Parameters:
e
- the value on which to apply the exponential function- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
exp
Builds an expression computing the value of the exponential function applied to the given value.- Parameters:
e
- the value on which to apply the exponential function- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
sum
Builds an expression computing the value of the aggregated sum of a given expression.This aggregation function is meant to be used in
PipelineStage.aggregateBy(Function, Function)
andPipelineStage.aggregate(Function)
.- Parameters:
e
- the expression to be aggregated- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
avg
Builds an expression computing the value of the aggregated average of a given expression.This aggregation function is meant to be used in
PipelineStage.aggregateBy(Function, Function)
andPipelineStage.aggregate(Function)
.- Parameters:
e
- the expression to be aggregated- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
min
Builds an expression computing the value of the aggregated minimum of a given expression.This aggregation function is meant to be used in
PipelineStage.aggregateBy(Function, Function)
andPipelineStage.aggregate(Function)
.- Parameters:
e
- the expression to be aggregated- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
max
Builds an expression computing the value of the aggregated maximum of a given expression.This aggregation function is meant to be used in
PipelineStage.aggregateBy(Function, Function)
andPipelineStage.aggregate(Function)
.- Parameters:
e
- the expression to be aggregated- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
count
Expression count()Builds an expression computing the number of aggregated rows.This aggregation function is meant to be used in
PipelineStage.aggregateBy(Function, Function)
andPipelineStage.aggregate(Function)
.- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
count
Builds an expression computing the number of aggregated non-null values of the given expression.This aggregation function is meant to be used in
PipelineStage.aggregateBy(Function, Function)
andPipelineStage.aggregate(Function)
.- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
- See Also:
-
caseWhen
Builds a conditional CASE WHEN expression.For example the following expression will evaluate to a different value depending on whether or not the sku contains "foo" or not.
def qapi = api.queryApi() def p = qapi.tables().products() def mealType = qapi.exprs().caseWhen( p.sku().like("%spamEgg%"), // boolean condition qapi.exprs().string("breakfast"), // value when condition evaluates to true qapi.exprs().string("generic meal") // value when condition evaluates to false )
- Parameters:
condition
- the conditional expressionthenExpr
- the resulting expression when condition is trueelseExpr
- the resulting expression when condition is false- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
coalesce
Builds an expression that will return the value of the first non-null resulting given expression.- Parameters:
exprs
- the ordered list of expressions from which the first non-null evaluated value will be chosen- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
nullIf
Builds an expression that will computes the standard SQL function NULLIF applied to the given expressions.This operator is documented on w3schools website
- Parameters:
exprs
- the ordered list of expressions on which to apply the standard SQL function NULLIF- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
string
Builds a literal string expression.- Parameters:
value
- the literal value- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
real
Builds a literal real expression.- Parameters:
value
- the literal value- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
integer
Builds a literal integer expression.- Parameters:
value
- the literal value- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
bool
Builds a literal boolean expression.- Parameters:
value
- the literal value- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
dateOnly
Builds a literal date expression from aDate
object ignoring all time related values.Note that even if
Date
objects can contain time value, this function will only extract the date related data (i.e. year, month and day), ignoring all time related values.- Parameters:
dateOnly
- the literal value- Returns:
- the built expression
- Since:
- 14.0 - Caribou Lou
-
dateTime
Builds a literal datetime expression from aDate
object.- Parameters:
dateTime
- the literal value- Returns:
- the built expression
-
dateTime
Builds a literal datetime expression from aDateTime
object.- Parameters:
dateTime
- the literal value- Returns:
- the built expression
-