org.d2rq.db.expr
Class Expression
java.lang.Object
org.d2rq.db.expr.Expression
- Direct Known Subclasses:
- BinaryOperator, BooleanToIntegerCaseExpression, ColumnExpr, ColumnListEquality, Concatenation, Conjunction, Constant, Disjunction, Negation, NotNull, SQLExpression, UnaryMinus
public abstract class Expression
- extends Object
A SQL expression.
TODO: Should introduce an ExpressionVisitor and replace most methods with implementations of that
- Author:
- Richard Cyganiak (richard@cyganiak.de)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TRUE
public static final Expression TRUE
FALSE
public static final Expression FALSE
Expression
public Expression()
isTrue
public abstract boolean isTrue()
isFalse
public abstract boolean isFalse()
isConstant
public abstract boolean isConstant()
isConstantColumn
public abstract boolean isConstantColumn(ColumnName column,
boolean constIfTrue,
boolean constIfFalse,
boolean constIfConstantValue)
- Checks whether this expression forces a given column to be a constant,
that is, have the same value everywhere. For example,
T.COL1=5 forces T.COL1 to be constant if the expression is assumed
to be true; T.COL1+1 forces it to be constant if the expression
is assumed to evaluate to a constant value. Exactly one of the three
constXXX arguments must be true, the other two must be false.
- Parameters:
column
- The column to be checkedconstIfTrue
- Is the column constant assuming the expression evaluates to true?constIfFalse
- Is the column constant assuming the expression evaluates to false?constIfConstantValue
- Is column constant assuming the expression evaluates to a value equal to some constant?
getColumns
public abstract Set<ColumnName> getColumns()
rename
public abstract Expression rename(Renamer columnRenamer)
getDataType
public abstract DataType getDataType(DatabaseOp table,
Vendor vendor)
toSQL
public abstract String toSQL(DatabaseOp table,
Vendor vendor)
and
public Expression and(Expression other)
or
public Expression or(Expression other)