org.d2rq.db.expr
Class ColumnListEquality
java.lang.Object
org.d2rq.db.expr.Expression
org.d2rq.db.expr.ColumnListEquality
public class ColumnListEquality
- extends Expression
Compares two lists of columns in two tables. Used as a convenient way
of representing join conditions in SQL joins.
- Author:
- Richard Cyganiak (richard@cyganiak.de)
Method Summary |
boolean |
containsColumn(ColumnName column)
|
static ColumnListEquality |
create(ColumnName oneSide,
ColumnName otherSide)
|
static ColumnListEquality |
create(TableName oneTable,
Key oneColumnList,
TableName otherTable,
Key otherColumnList)
|
boolean |
equals(Object o)
|
Set<ColumnName> |
getColumns()
|
Key |
getColumns1()
|
Key |
getColumns2()
|
DataType |
getDataType(DatabaseOp table,
Vendor vendor)
|
ColumnName |
getEqualColumn(ColumnName column)
|
TableName |
getTableName1()
|
TableName |
getTableName2()
|
int |
hashCode()
|
boolean |
isConstant()
|
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. |
boolean |
isFalse()
|
boolean |
isSameTable()
|
boolean |
isTrue()
|
Expression |
rename(Renamer renamer)
|
String |
toSQL(DatabaseOp table,
Vendor vendor)
|
String |
toString()
|
create
public static ColumnListEquality create(ColumnName oneSide,
ColumnName otherSide)
create
public static ColumnListEquality create(TableName oneTable,
Key oneColumnList,
TableName otherTable,
Key otherColumnList)
isSameTable
public boolean isSameTable()
containsColumn
public boolean containsColumn(ColumnName column)
getTableName1
public TableName getTableName1()
getTableName2
public TableName getTableName2()
getColumns1
public Key getColumns1()
getColumns2
public Key getColumns2()
getEqualColumn
public ColumnName getEqualColumn(ColumnName column)
isTrue
public boolean isTrue()
- Specified by:
isTrue
in class Expression
isFalse
public boolean isFalse()
- Specified by:
isFalse
in class Expression
isConstant
public boolean isConstant()
- Specified by:
isConstant
in class Expression
isConstantColumn
public boolean isConstantColumn(ColumnName column,
boolean constIfTrue,
boolean constIfFalse,
boolean constIfConstantValue)
- Description copied from class:
Expression
- 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.
- Specified by:
isConstantColumn
in class Expression
- 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 Set<ColumnName> getColumns()
- Specified by:
getColumns
in class Expression
rename
public Expression rename(Renamer renamer)
- Specified by:
rename
in class Expression
getDataType
public DataType getDataType(DatabaseOp table,
Vendor vendor)
- Specified by:
getDataType
in class Expression
toSQL
public String toSQL(DatabaseOp table,
Vendor vendor)
- Specified by:
toSQL
in class Expression
toString
public String toString()
- Overrides:
toString
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object