org.d2rq.db.op
Class InnerJoinOp
java.lang.Object
org.d2rq.db.op.InnerJoinOp
- All Implemented Interfaces:
- DatabaseOp
public class InnerJoinOp
- extends Object
- implements DatabaseOp
An inner join between multiple NamedOp
s.
Note that other kinds of DatabaseOp
s are not allowed as children.
This constraint ensures that no additional information
(e.g., artificial table names) need to be added during conversion to SQL.
When joining of non-NamedOp
is desired, then they need to be
wrapped into an AliasOp
, or pulled up above the inner
join where possible (e.g., for SelectOp
).
- Author:
- Richard Cyganiak (richard@cyganiak.de)
join
public static DatabaseOp join(NamedOp table1,
NamedOp table2,
Key key1,
Key key2)
join
public static DatabaseOp join(Collection<NamedOp> tables,
Set<ColumnListEquality> joinConditions)
getTables
public Collection<NamedOp> getTables()
getTable
public DatabaseOp getTable(TableName name)
getJoinConditions
public Set<ColumnListEquality> getJoinConditions()
getTableName
public TableName getTableName()
- Specified by:
getTableName
in interface DatabaseOp
- Returns:
- Name in [[CATALOG.]SCHEMA.]TABLE notation, possibly
null
hasColumn
public boolean hasColumn(ColumnName column)
- Specified by:
hasColumn
in interface DatabaseOp
- Parameters:
column
- A qualified or unqualified column name
- Returns:
false
for ambiguous unqualified names
getColumns
public List<ColumnName> getColumns()
- Specified by:
getColumns
in interface DatabaseOp
- Returns:
- Fully qualified column names if possible, no duplicates
isNullable
public boolean isNullable(ColumnName column)
- Specified by:
isNullable
in interface DatabaseOp
getColumnType
public DataType getColumnType(ColumnName column)
- Specified by:
getColumnType
in interface DatabaseOp
getUniqueKeys
public Collection<Key> getUniqueKeys()
- Specified by:
getUniqueKeys
in interface DatabaseOp
accept
public void accept(OpVisitor visitor)
- Specified by:
accept
in interface DatabaseOp
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