class DynamicJoin extends java.lang.Object implements Join
leftTable JOIN rightTable ON columns
.
This class is used by, for example, DynamicSpotQuery.joinReporters(JoinType)
to create the Join
query element that is needed.
Modifier and Type | Field and Description |
---|---|
private int |
hashCode |
private JoinType |
joinType |
private VirtualTable |
left |
private VirtualColumn[] |
leftColumns |
private VirtualTable |
right |
private VirtualColumn[] |
rightColumns |
private VirtualDb |
vdb |
Constructor and Description |
---|
DynamicJoin(VirtualDb vdb,
JoinType joinType,
VirtualTable right,
VirtualColumn... columns)
Create a new join using the root entity table as the left table.
|
DynamicJoin(VirtualDb vdb,
JoinType joinType,
VirtualTable left,
VirtualColumn[] leftColumns,
VirtualTable right,
VirtualColumn[] rightColumns)
Create a new join between two tables with possible different colum names in
the left and right tables.
|
DynamicJoin(VirtualDb vdb,
JoinType joinType,
VirtualTable left,
VirtualTable right,
VirtualColumn... columns)
Create a new join between two tables.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
This join is equal to another DynamicJoin if they
join between the same tables using the same columns and join types.
|
java.util.Collection<? extends QueryElement> |
getChildren()
Get the children of this query element or null if it has no children.
|
java.lang.String |
getThetaJoin(Query query,
DbControl dc) |
java.lang.String |
getThetaJoinCondition(Query query,
DbControl dc) |
int |
hashCode() |
java.lang.String |
toQl(Query query,
DbControl dc)
Create a query language string of the query element.
|
java.lang.String |
toString() |
private final VirtualDb vdb
private final JoinType joinType
private final VirtualTable left
private final VirtualTable right
private final VirtualColumn[] leftColumns
private final VirtualColumn[] rightColumns
private int hashCode
DynamicJoin(VirtualDb vdb, JoinType joinType, VirtualTable right, VirtualColumn... columns)
SELECT ... FROM rootTable JOIN right ON columns
.vdb
- The virtual database where the joined table is locatedjoinType
- The type of joinright
- The table to join tocolumns
- The columns to join on, all columns must exists in
the root table and the joined tableDynamicJoin(VirtualDb vdb, JoinType joinType, VirtualTable left, VirtualTable right, VirtualColumn... columns)
SELECT ... FROM rootTable ... JOIN left ... JOIN right ON columns
vdb
- The virtual database where the joined table is locatedjoinType
- The type of joinleft
- The table to join fromright
- The table to join tocolumns
- The columns to join on, all columns must exists in
the left table and the right tableDynamicJoin(VirtualDb vdb, JoinType joinType, VirtualTable left, VirtualColumn[] leftColumns, VirtualTable right, VirtualColumn[] rightColumns)
vdb
- The virtual database where the joined table is locatedjoinType
- The type of joinleft
- The table to join from (or null to join from the root table)leftColumns
- The columns in the left table to use in the joinright
- The table to join torightColumns
- The columns in the right table (must be of same length as leftColumns)public java.lang.String toQl(Query query, DbControl dc) throws BaseException
QueryElement
Query.getQueryType()
method to find out which query language is wanted
in case the element requires different syntax for different languages.toQl
in interface QueryElement
query
- The query that is about to be executeddc
- The DbControl
object used to execute the queryBaseException
- If there is any other errorpublic java.util.Collection<? extends QueryElement> getChildren()
QueryElement
AddExpression
has two children, the expression
beeing added.getChildren
in interface QueryElement
public java.lang.String getThetaJoin(Query query, DbControl dc) throws BaseException
getThetaJoin
in interface Join
BaseException
public java.lang.String getThetaJoinCondition(Query query, DbControl dc) throws BaseException
getThetaJoinCondition
in interface Join
BaseException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object