Package com.inet.report
Class Join
java.lang.Object
com.inet.report.Join
- All Implemented Interfaces:
NodeParser
,com.inet.report.ReferenceHolder
,Serializable
public class Join
extends Object
implements Serializable, com.inet.report.ReferenceHolder, NodeParser
A Join represents a connection between two tables. It is vectored and points from the source table to the target table.
There are four kind of Joins: INNER, OUTER, LEFT OUTER and RIGHT OUTER.
The connection will be created by one or more links between the table columns.
There are six kinds of linktypes:
A link between both tables will be called here as join condition.
A join condition consists of two columns, a column from source table and a column from target table, and the link type.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCondition
(DatabaseField sourceColumn, DatabaseField targetColumn, int linkType) Adds a join condition to this Join Object.void
addCondition
(String sourceColumn, String targetColumn, int linkType) Adds a join condition to this Join Object.final void
addReferencedObject
(com.inet.report.ReferencedObject reference) FOR INTERNAL USE ONLY Adds aReferencedObject
to the list of objects which this object is referencing.int
Returns the number of join conditions.int
getConditionLinkType
(int i) Returns the link type of the specified condition.int[]
Returns the link types of all join conditions.getConditionSourceColumn
(int i) Returns the column name from source table, used in the specified condition.String[]
Returns all columns from source table, that are used for the join conditions.Returns all fields from source table, that are used for the join conditions.getConditionTargetColumn
(int i) Returns the column name from target table, used in the specified condition.String[]
Returns all columns from target table, that are used for the join conditions.Returns all fields from target table, that are used for the join conditions.int
Returns the join type of this Join.final int
FOR INTERNAL USE ONLYfinal int
FOR INTERNAL USE ONLY Returns the number ofReferencedObject
s which this object is referencing at the moment.final com.inet.report.ReferencedObject[]
FOR INTERNAL USE ONLY Returns theReferencedObject
s this object is referencing currently.Returns the source alias name for the source tables.Returns the TableSource Object of the source table.Returns the target alias name for the source tables.Returns the TableSource Object of the target table.boolean
FOR INTERNAL USE ONLY Internal method for reading report XMLReturns a String representation of this Join.void
FOR INTERNAL USE ONLY Internal method for reading report XMLparseElement
(com.inet.report.parser.XMLTag group, String tag, Attributes atts, Map<String, Object> parserMap) FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
parseEndElement
(com.inet.report.parser.XMLTag group, String tag, Map<String, Object> parserMap) FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
removeCondition
(int i) Removes a condition from the join.final void
removeReferencedObject
(com.inet.report.ReferencedObject reference) FOR INTERNAL USE ONLY Removes aReferencedObject
from the list of objects which this object is referencing.final void
FOR INTERNAL USE ONLYvoid
setJoinType
(int newJoinType) Sets the join type of this Join object.final void
FOR INTERNAL USE ONLYvoid
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.
-
Method Details
-
getJoinType
public int getJoinType()Returns the join type of this Join. The join type defines the data linking of the both tablesources of this join.- Returns:
- the join type of this Join.
- Since:
- 6.0
- See Also:
-
setJoinType
public void setJoinType(int newJoinType) Sets the join type of this Join object.- Parameters:
newJoinType
- the new join type for this Join object.- Since:
- 6.0
- See Also:
-
getSourceAlias
Returns the source alias name for the source tables.- Returns:
- the alias name of the source table.
- Since:
- 6.0
-
getSourceTableSource
Returns the TableSource Object of the source table.- Returns:
- the TableSource Object of the source table.
- Since:
- 6.1
-
getTargetAlias
Returns the target alias name for the source tables.- Returns:
- the alias name of the target table.
- Since:
- 6.0
-
getTargetTableSource
Returns the TableSource Object of the target table.- Returns:
- the TableSource Object of the target table.
- Since:
- 6.1
-
addCondition
Adds a join condition to this Join Object. A join condition consists of two columns, one column of source table and one column of target table, and the column link.
example:
join.addCondition("orderId","orderId",DatabaseTables.JOINLINK_GREATER_THAN);
- Parameters:
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.- Throws:
IllegalArgumentException
- If no database field could be found for sourceColumn or targetColumn.- Since:
- 6.0
- See Also:
-
addCondition
Adds a join condition to this Join Object. A join condition consists of two columns, one column of source table and one column of target table, and the column link.
example:
join.addCondition(sourceTableSource.getDatabaseField("orderId"),targetTableSource.getDatabaseField("orderId"),DatabaseTables.JOINLINK_GREATER_THAN);
- Parameters:
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.- Since:
- 6.1
- See Also:
-
removeCondition
public void removeCondition(int i) Removes a condition from the join.- Parameters:
i
- condition index to remove. The index of the first condition is 0.- Throws:
ArrayIndexOutOfBoundsException
- if the index is less than 0, greater than or equals the condition count.- Since:
- 6.0
- See Also:
-
getConditionCount
public int getConditionCount()Returns the number of join conditions.- Returns:
- the count of the join conditions.
- Since:
- 6.0
- See Also:
-
getConditionSourceColumn
Returns the column name from source table, used in the specified condition.- Parameters:
i
- the index of the condition. The index of the first condition is 0.- Returns:
- the column name of the source table for the respective condition.
- Throws:
ArrayIndexOutOfBoundsException
- if the index is less than 0, greater than or equals the condition count.- Since:
- 6.0
- See Also:
-
getConditionTargetColumn
Returns the column name from target table, used in the specified condition.- Parameters:
i
- the index of the condition. The index of the first condition is 0.- Returns:
- the column name of the target table for the respective condition.
- Throws:
ArrayIndexOutOfBoundsException
- if the index is less than 0, greater than or equals the condition count.- Since:
- 6.0
- See Also:
-
getConditionLinkType
public int getConditionLinkType(int i) Returns the link type of the specified condition.- Parameters:
i
- the index of the condition. The index of the first condition is 0.- Returns:
- the link type for the respective condition.
- Throws:
ArrayIndexOutOfBoundsException
- if the index is less than 0, greater than or equals the condition count.- Since:
- 6.0
- See Also:
-
getConditionSourceColumns
Returns all columns from source table, that are used for the join conditions.- Returns:
- a String array containing all columns from source table, that are used for the join conditions.
- Since:
- 6.0
- See Also:
-
getConditionSourceFields
Returns all fields from source table, that are used for the join conditions.- Returns:
- a DatabaseField array containing all columns from source table, that are used for the join conditions.
- Since:
- 6.1
- See Also:
-
getConditionTargetFields
Returns all fields from target table, that are used for the join conditions.- Returns:
- a DatabaseField array containing all columns from target table, that are used for the join conditions.
- Since:
- 6.1
- See Also:
-
getConditionTargetColumns
Returns all columns from target table, that are used for the join conditions.- Returns:
- a String array containing all columns from target table, that are used for the join conditions.
- Since:
- 6.0
- See Also:
-
getConditionLinkTypes
public int[] getConditionLinkTypes()Returns the link types of all join conditions.- Returns:
- an int array containing the link types of all join conditions.
- Since:
- 6.0
- See Also:
-
paramString
Returns a String representation of this Join.- Returns:
- a String representation of this Join.
- Since:
- 6.0
-
swapJoin
public 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.For instance, an right join from A to B with link type '<' will become an left join from B to A with link type '>'.
- Since:
- 15.0
-
isDOMParser
public boolean isDOMParser()FOR INTERNAL USE ONLY Internal method for reading report XMLReturns whether this node is to be read via a DOM parser.
- Specified by:
isDOMParser
in interfaceNodeParser
- Returns:
- true if this node is to be read via a DOM parser, false otherwise.
-
parseDOM
FOR INTERNAL USE ONLY Internal method for reading report XMLParses the node.
- Specified by:
parseDOM
in interfaceNodeParser
- Parameters:
node
- the nodeparserMap
- The map of current Parser.- Throws:
FatalParserException
- if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
-
parseElement
public NodeParser parseElement(com.inet.report.parser.XMLTag group, String tag, Attributes atts, Map<String, Object> parserMap) throws FatalParserExceptionFOR INTERNAL USE ONLY Internal method for reading report XMLParses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.
- Specified by:
parseElement
in interfaceNodeParser
- Parameters:
group
- XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.tag
- The XMLTag to be parsedatts
- The set of attributes in the current XMLTagparserMap
- The map of current Parser.- Returns:
- The NodeParser sub-element if one needed to be created, or null if none was created.
- Throws:
FatalParserException
- if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
-
parseEndElement
public void parseEndElement(com.inet.report.parser.XMLTag group, String tag, Map<String, Object> parserMap) throws FatalParserExceptionFOR INTERNAL USE ONLY Internal method for reading report XMLReceive notification of the end of an XML tag.
- Specified by:
parseEndElement
in interfaceNodeParser
- Parameters:
group
- XMLTag of the current node to be parsed, or null if there is no such current group.tag
- The XMLTag to be parsedparserMap
- The map of current Parser.- Throws:
FatalParserException
- if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
-
parseText
FOR INTERNAL USE ONLY Internal method for reading report XMLThis method is called if text was encountered in the context of this node. (Examples would be a formula's text or a text element's text)
- Specified by:
parseText
in interfaceNodeParser
- Parameters:
text
- text encountered and to be storedparserMap
- The map of current Parser.
-
addReferencedObject
public final void addReferencedObject(com.inet.report.ReferencedObject reference) FOR INTERNAL USE ONLY Adds aReferencedObject
to the list of objects which this object is referencing.- Specified by:
addReferencedObject
in interfacecom.inet.report.ReferenceHolder
- Parameters:
reference
- the referenced object- Since:
- 6.0
- See Also:
-
ReferenceHolder.addReferencedObject(com.inet.report.ReferencedObject)
-
removeReferencedObject
public final void removeReferencedObject(com.inet.report.ReferencedObject reference) FOR INTERNAL USE ONLY Removes aReferencedObject
from the list of objects which this object is referencing.- Specified by:
removeReferencedObject
in interfacecom.inet.report.ReferenceHolder
- Parameters:
reference
- the referenced object- Since:
- 6.0
- See Also:
-
ReferenceHolder.removeReferencedObject(com.inet.report.ReferencedObject)
-
getRealReferencedObjectCount
public final int getRealReferencedObjectCount()FOR INTERNAL USE ONLY- Specified by:
getRealReferencedObjectCount
in interfacecom.inet.report.ReferenceHolder
- Returns:
- the count of real referenced objects
- Since:
- 6.0
- See Also:
-
ReferenceHolder.getRealReferencedObjectCount()
-
getReferencedObjectCount
public final int getReferencedObjectCount()FOR INTERNAL USE ONLY Returns the number ofReferencedObject
s which this object is referencing at the moment.- Specified by:
getReferencedObjectCount
in interfacecom.inet.report.ReferenceHolder
- Returns:
- the count of referenced objects
- Since:
- 6.0
- See Also:
-
ReferenceHolder.getReferencedObjectCount()
-
getReferencedObjects
public final com.inet.report.ReferencedObject[] getReferencedObjects()FOR INTERNAL USE ONLY Returns theReferencedObject
s this object is referencing currently.- Specified by:
getReferencedObjects
in interfacecom.inet.report.ReferenceHolder
- Returns:
- the referenced objects
- Since:
- 6.0
- See Also:
-
ReferenceHolder.getReferencedObjects()
-
setReferences
public final void setReferences()FOR INTERNAL USE ONLY- Specified by:
setReferences
in interfacecom.inet.report.ReferenceHolder
- Since:
- 6.0
-
resetReferences
public final void resetReferences()FOR INTERNAL USE ONLY- Specified by:
resetReferences
in interfacecom.inet.report.ReferenceHolder
- Since:
- 6.0
-