org.d2rq.db.op
Class InnerJoinOp

java.lang.Object
  extended by org.d2rq.db.op.InnerJoinOp
All Implemented Interfaces:
DatabaseOp

public class InnerJoinOp
extends Object
implements DatabaseOp

An inner join between multiple NamedOps. Note that other kinds of DatabaseOps 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)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.d2rq.db.op.DatabaseOp
DatabaseOp.Wrapper
 
Field Summary
 
Fields inherited from interface org.d2rq.db.op.DatabaseOp
TRUE
 
Method Summary
 void accept(OpVisitor visitor)
           
 boolean equals(Object o)
           
 List<ColumnName> getColumns()
           
 DataType getColumnType(ColumnName column)
           
 Set<ColumnListEquality> getJoinConditions()
           
 DatabaseOp getTable(TableName name)
           
 TableName getTableName()
           
 Collection<NamedOp> getTables()
           
 Collection<Key> getUniqueKeys()
           
 boolean hasColumn(ColumnName column)
           
 int hashCode()
           
 boolean isNullable(ColumnName column)
           
static DatabaseOp join(Collection<NamedOp> tables, Set<ColumnListEquality> joinConditions)
           
static DatabaseOp join(NamedOp table1, NamedOp table2, Key key1, Key key2)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

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