Package com.exasol.sql.expression
Class BooleanTerm
- java.lang.Object
-
- com.exasol.sql.expression.AbstractBooleanExpression
-
- com.exasol.sql.expression.BooleanTerm
-
- All Implemented Interfaces:
BooleanExpression
,ValueExpression
public abstract class BooleanTerm extends AbstractBooleanExpression
This class represents boolean terms likeAND
orNOT
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BooleanExpression
and(boolean... values)
LogicalAND
combination of boolean values.static BooleanExpression
and(boolean value, BooleanExpression expression)
LogicalAND
combination of boolean value and expression.static BooleanExpression
and(BooleanExpression... expressions)
LogicalAND
combination of boolean expressions.static BooleanExpression
and(BooleanExpression expression, boolean value)
LogicalAND
combination of boolean expression and value.static BooleanExpression
between(ValueExpression expression, ValueExpression start, ValueExpression end)
Check if value is between two other values.static BooleanExpression
compare(ValueExpression left, SimpleComparisonOperator operator, ValueExpression right)
General comparison with operator enum.static BooleanExpression
compare(ValueExpression left, String operatorSymbol, ValueExpression right)
General comparison with operator as string.static BooleanExpression
eq(ValueExpression left, ValueExpression right)
Equality comparison.static BooleanExpression
exists(Select select)
Check if the sub-select has any result.static BooleanExpression
ge(ValueExpression left, ValueExpression right)
Greater-than-or-equal comparison.static BooleanExpression
gt(ValueExpression left, ValueExpression right)
Greater-than comparison.static BooleanExpression
in(ValueExpression operand, Select select)
Check for value sub-select.static BooleanExpression
in(ValueExpression toFind, ValueExpression... inList)
Check for value in list.static BooleanExpression
isNotNull(ValueExpression operand)
Check for not null.static BooleanExpression
isNull(ValueExpression operand)
Check for null.static BooleanExpression
le(ValueExpression left, ValueExpression right)
Less-than-or-equal comparison.static BooleanExpression
like(ValueExpression left, ValueExpression right)
Comparison withLIKE
operator.static BooleanExpression
like(ValueExpression left, ValueExpression right, char escape)
Comparison withLIKE
operator.static BooleanExpression
lt(ValueExpression left, ValueExpression right)
Less-than comparison.static BooleanExpression
ne(ValueExpression left, ValueExpression right)
Not-equal comparison.static BooleanExpression
not(boolean value)
UnaryNOT
of boolean value.static BooleanExpression
not(BooleanExpression expression)
UnaryNOT
of boolean expression.static BooleanExpression
notBetween(ValueExpression expression, ValueExpression start, ValueExpression end)
Check if value is not between two other values.static BooleanExpression
notIn(ValueExpression operand, Select select)
Check if value not in sub-select.static BooleanExpression
notIn(ValueExpression toFind, ValueExpression... inList)
Check if value not in list.static BooleanExpression
notLike(ValueExpression left, ValueExpression right)
Comparison with invertedLIKE
operator.static BooleanExpression
notLike(ValueExpression left, ValueExpression right, char escape)
Comparison with invertedLIKE
operator.static BooleanExpression
operation(String operator, BooleanExpression... expressions)
Create a logical operation from an operator name and a list of operandsstatic BooleanExpression
or(boolean... values)
LogicalOR
combination of boolean values.static BooleanExpression
or(boolean value, BooleanExpression expression)
LogicalOR
combination of boolean value and expression.static BooleanExpression
or(BooleanExpression... expressions)
LogicalOR
combination of boolean expressions.static BooleanExpression
or(BooleanExpression expression, boolean value)
LogicalOR
combination of boolean expression and value.-
Methods inherited from class com.exasol.sql.expression.AbstractBooleanExpression
accept
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.exasol.sql.expression.BooleanExpression
accept
-
-
-
-
Method Detail
-
not
public static BooleanExpression not(boolean value)
UnaryNOT
of boolean value.- Parameters:
value
- value to invert- Returns:
- inverted value
-
not
public static BooleanExpression not(BooleanExpression expression)
UnaryNOT
of boolean expression.- Parameters:
expression
- expression that should be inverted- Returns:
- inverted epression
-
and
public static BooleanExpression and(boolean... values)
LogicalAND
combination of boolean values.- Parameters:
values
- values to combine- Returns:
- logical
AND
combination
-
and
public static BooleanExpression and(BooleanExpression expression, boolean value)
LogicalAND
combination of boolean expression and value.- Parameters:
expression
- boolean expressionvalue
- boolean value- Returns:
- logical
AND
combination
-
and
public static BooleanExpression and(boolean value, BooleanExpression expression)
LogicalAND
combination of boolean value and expression.- Parameters:
value
- boolean valueexpression
- boolean expression- Returns:
- logical
AND
combination
-
and
public static BooleanExpression and(BooleanExpression... expressions)
LogicalAND
combination of boolean expressions.- Parameters:
expressions
- boolean expressions- Returns:
- logical
AND
combination
-
or
public static BooleanExpression or(boolean... values)
LogicalOR
combination of boolean values.- Parameters:
values
- boolean values- Returns:
- logical
OR
combination
-
or
public static BooleanExpression or(BooleanExpression expression, boolean value)
LogicalOR
combination of boolean expression and value.- Parameters:
expression
- boolean expressionvalue
- boolean values- Returns:
- logical
OR
combination
-
or
public static BooleanExpression or(boolean value, BooleanExpression expression)
LogicalOR
combination of boolean value and expression.- Parameters:
value
- boolean valuesexpression
- boolean expression- Returns:
- logical
OR
combination
-
or
public static BooleanExpression or(BooleanExpression... expressions)
LogicalOR
combination of boolean expressions.- Parameters:
expressions
- boolean values- Returns:
- logical
OR
combination
-
like
public static BooleanExpression like(ValueExpression left, ValueExpression right)
Comparison withLIKE
operator.- Parameters:
left
- left operandright
- right operand- Returns:
LIKE
comparison
-
like
public static BooleanExpression like(ValueExpression left, ValueExpression right, char escape)
Comparison withLIKE
operator.- Parameters:
left
- left operandright
- right operandescape
- escape character- Returns:
LIKE
comparison
-
notLike
public static BooleanExpression notLike(ValueExpression left, ValueExpression right)
Comparison with invertedLIKE
operator.- Parameters:
left
- left operandright
- right operand- Returns:
- inverted
LIKE
comparison
-
notLike
public static BooleanExpression notLike(ValueExpression left, ValueExpression right, char escape)
Comparison with invertedLIKE
operator.- Parameters:
left
- left operandright
- right operandescape
- escape character- Returns:
- inverted
LIKE
comparison
-
compare
public static BooleanExpression compare(ValueExpression left, String operatorSymbol, ValueExpression right)
General comparison with operator as string.- Parameters:
left
- left operandoperatorSymbol
- operatorright
- right operand- Returns:
- comparison
-
compare
public static BooleanExpression compare(ValueExpression left, SimpleComparisonOperator operator, ValueExpression right)
General comparison with operator enum.- Parameters:
left
- left operandoperator
- operatorright
- right operand- Returns:
- comparison
-
eq
public static BooleanExpression eq(ValueExpression left, ValueExpression right)
Equality comparison.- Parameters:
left
- left operandright
- right operand- Returns:
- comparison
-
ne
public static BooleanExpression ne(ValueExpression left, ValueExpression right)
Not-equal comparison.- Parameters:
left
- left operandright
- right operand- Returns:
- comparison
-
lt
public static BooleanExpression lt(ValueExpression left, ValueExpression right)
Less-than comparison.- Parameters:
left
- left operandright
- right operand- Returns:
- comparison
-
gt
public static BooleanExpression gt(ValueExpression left, ValueExpression right)
Greater-than comparison.- Parameters:
left
- left operandright
- right operand- Returns:
- comparison
-
le
public static BooleanExpression le(ValueExpression left, ValueExpression right)
Less-than-or-equal comparison.- Parameters:
left
- left operandright
- right operand- Returns:
- comparison
-
ge
public static BooleanExpression ge(ValueExpression left, ValueExpression right)
Greater-than-or-equal comparison.- Parameters:
left
- left operandright
- right operand- Returns:
- comparison
-
isNull
public static BooleanExpression isNull(ValueExpression operand)
Check for null.- Parameters:
operand
- operand to be checked for null value- Returns:
- null check
-
isNotNull
public static BooleanExpression isNotNull(ValueExpression operand)
Check for not null.- Parameters:
operand
- operand to be checked for not null- Returns:
- not-null check
-
in
public static BooleanExpression in(ValueExpression toFind, ValueExpression... inList)
Check for value in list.- Parameters:
toFind
- operand to find in listinList
- list to search the first operand in- Returns:
- in-list search
-
notIn
public static BooleanExpression notIn(ValueExpression toFind, ValueExpression... inList)
Check if value not in list.- Parameters:
toFind
- operand to find in listinList
- list to search the first operand in- Returns:
- not-in-list search
-
in
public static BooleanExpression in(ValueExpression operand, Select select)
Check for value sub-select.- Parameters:
operand
- operand to find in listselect
- sub-select to search the operand in- Returns:
- in-sub-select search
-
notIn
public static BooleanExpression notIn(ValueExpression operand, Select select)
Check if value not in sub-select.- Parameters:
operand
- operand to find in listselect
- sub-select to search the operand in- Returns:
- not-in-sub-select search
-
exists
public static BooleanExpression exists(Select select)
Check if the sub-select has any result.- Parameters:
select
- sub-select- Returns:
- exists-check
-
between
public static BooleanExpression between(ValueExpression expression, ValueExpression start, ValueExpression end)
Check if value is between two other values.- Parameters:
expression
- expression to checkstart
- interval startend
- interval end- Returns:
- between-check
-
notBetween
public static BooleanExpression notBetween(ValueExpression expression, ValueExpression start, ValueExpression end)
Check if value is not between two other values.- Parameters:
expression
- expression to checkstart
- interval startend
- interval end- Returns:
- not-between-check
-
operation
public static BooleanExpression operation(String operator, BooleanExpression... expressions)
Create a logical operation from an operator name and a list of operands- Parameters:
operator
- name of the operatorexpressions
- operands- Returns:
- instance of either
And
,Or
orNot
- Throws:
IllegalArgumentException
- if the operator is unknown or null
-
-