public class Join extends java.lang.Object implements java.io.Serializable, com.inet.report.ReferenceHolder, NodeParser
Modifier and Type | Method and Description |
---|---|
void |
addCondition(java.lang.String sourceColumn,
java.lang.String targetColumn,
int linkType)
Adds a join condition to this Join Object.
|
void |
addCondition(DatabaseField sourceColumn,
DatabaseField targetColumn,
int linkType)
Adds a join condition to this Join Object.
|
int |
getConditionCount()
Returns the number of join conditions.
|
int |
getConditionLinkType(int i)
Returns the link type of the specified condition.
|
int[] |
getConditionLinkTypes()
Returns the link types of all join conditions.
|
java.lang.String |
getConditionSourceColumn(int i)
Returns the column name from source table, used in the specified condition.
|
java.lang.String[] |
getConditionSourceColumns()
Returns all columns from source table, that are used for the join conditions.
|
DatabaseField[] |
getConditionSourceFields()
Returns all fields from source table, that are used for the join conditions.
|
java.lang.String |
getConditionTargetColumn(int i)
Returns the column name from target table, used in the specified condition.
|
java.lang.String[] |
getConditionTargetColumns()
Returns all columns from target table, that are used for the join conditions.
|
DatabaseField[] |
getConditionTargetFields()
Returns all fields from target table, that are used for the join conditions.
|
int |
getJoinType()
Returns the join type of this Join.
|
java.lang.String |
getSourceAlias()
Returns the source alias name for the source tables.
|
TableSource |
getSourceTableSource()
Returns the TableSource Object of the source table.
|
java.lang.String |
getTargetAlias()
Returns the target alias name for the source tables.
|
TableSource |
getTargetTableSource()
Returns the TableSource Object of the target table.
|
java.lang.String |
paramString()
Returns a String representation of this Join.
|
void |
removeCondition(int i)
Removes a condition from the join.
|
void |
setJoinType(int newJoinType)
Sets the join type of this Join object.
|
void |
swapJoin()
Inverses the join by swapping the source and target table, and changes the
join type and link to make the inverted join equivalent to the current join.
|
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
public int getJoinType()
setJoinType(int)
,
DatabaseTables.JOINTYPE_INNER
,
DatabaseTables.JOINTYPE_LEFT_OUTER
,
DatabaseTables.JOINTYPE_RIGHT_OUTER
,
DatabaseTables.JOINTYPE_FULL_OUTER
public void setJoinType(int newJoinType)
newJoinType
- the new join type for this Join object.getJoinType()
,
DatabaseTables.JOINTYPE_INNER
,
DatabaseTables.JOINTYPE_LEFT_OUTER
,
DatabaseTables.JOINTYPE_RIGHT_OUTER
,
DatabaseTables.JOINTYPE_FULL_OUTER
public java.lang.String getSourceAlias()
public TableSource getSourceTableSource()
public java.lang.String getTargetAlias()
public TableSource getTargetTableSource()
public void addCondition(java.lang.String sourceColumn, java.lang.String targetColumn, int linkType)
join.addCondition("orderId","orderId",DatabaseTables.JOINLINK_GREATER_THAN);
sourceColumn
- the column name of the source table that is used in this condition.targetColumn
- the column name of the target table that is used in this condition.linkType
- the link type with that both columns are linked together.java.lang.IllegalArgumentException
- If no database field could be found for
sourceColumn or targetColumn.removeCondition(int)
public void addCondition(DatabaseField sourceColumn, DatabaseField targetColumn, int linkType)
join.addCondition(sourceTableSource.getDatabaseField("orderId"),targetTableSource.getDatabaseField("orderId"),DatabaseTables.JOINLINK_GREATER_THAN);
sourceColumn
- the column of the source table that is used in this condition.targetColumn
- the column of the target table that is used in this condition.linkType
- the link type with that both columns are linked together.removeCondition(int)
public void removeCondition(int i)
i
- condition index to remove. The index of the first condition is 0.java.lang.ArrayIndexOutOfBoundsException
- if the index is less than 0, greater than or equals the condition count.addCondition(String, String, int)
,
getConditionCount()
public int getConditionCount()
getConditionSourceColumn(int)
,
getConditionTargetColumn(int)
,
getConditionLinkType(int)
public java.lang.String getConditionSourceColumn(int i)
i
- the index of the condition. The index of the first condition is 0.java.lang.ArrayIndexOutOfBoundsException
- if the index is less than 0, greater than or equals the condition count.getConditionCount()
,
getConditionTargetColumn(int)
,
getConditionLinkType(int)
public java.lang.String getConditionTargetColumn(int i)
i
- the index of the condition. The index of the first condition is 0.java.lang.ArrayIndexOutOfBoundsException
- if the index is less than 0, greater than or equals the condition count.getConditionCount()
,
getConditionSourceColumn(int)
,
getConditionLinkType(int)
public int getConditionLinkType(int i)
i
- the index of the condition. The index of the first condition is 0.java.lang.ArrayIndexOutOfBoundsException
- if the index is less than 0, greater than or equals the condition count.getConditionCount()
,
getConditionTargetColumn(int)
,
getConditionSourceColumn(int)
public java.lang.String[] getConditionSourceColumns()
getConditionTargetColumns()
,
getConditionLinkTypes()
public DatabaseField[] getConditionSourceFields()
getConditionTargetColumns()
,
getConditionLinkTypes()
public DatabaseField[] getConditionTargetFields()
getConditionSourceColumns()
,
getConditionLinkTypes()
public java.lang.String[] getConditionTargetColumns()
getConditionSourceColumns()
,
getConditionLinkTypes()
public int[] getConditionLinkTypes()
getConditionSourceColumns()
,
getConditionTargetColumns()
public java.lang.String paramString()
public void swapJoin()
For instance, an right join from A to B with link type '<' will become an left join from B to A with link type '>'.
Copyright © 1999-2020 by i-net software GmbH