JOIN enables the fetching of an association as a side effect of the
execution of a query. A JOIN is specified over an entity and its related
entities.
BNF: join ::= join_spec join_association_path_expression [AS] identification_variable
A JOIN FETCH enables the fetching of an association as a side effect of the execution of a query. A JOIN FETCH is specified over an entity and its related entities.
BNF: fetch_join ::= join_spec FETCH join_association_path_expression
Join
| Modifier and Type | Field and Description |
|---|---|
| private boolean | as
Flag used to determine if the |
| public static final String | AS_PROPERTY
Notifies the visibility of the |
| private IdentificationVariableStateObject | identificationVariable
The state object holding the identification variable. |
| public static final String | JOIN_TYPE_PROPERTY
Notifies the join type property has changed. |
| private CollectionValuedPathExpressionStateObject | joinAssociationPath
The state object holding the join association path. |
| private String | joinType
One of the joining types used by this state object. |
| Access | Constructor and Description |
|---|---|
| public | JoinStateObject(AbstractIdentificationVariableDeclarationStateObject
The parent of this state object parent, String One of the joining types joinType)Creates a new |
| public | JoinStateObject(AbstractIdentificationVariableDeclarationStateObject
The parent of this state object parent, String One of the joining types joinType, boolean Determine whether the as)AS identifier is used or notCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(StateObjectVisitor
The visitor)visitor to visit this objectImplements org. StateObject by the given visitor.
|
| public JoinStateObject | |
| protected void | addChildren(List<StateObject>
The list used to store the children children)Overrides org. StateObject to the given list.
|
| public void | addJoinAssociationPaths(List<String>
The new path expression paths)Adds the given segments to the end of the join association path expression. |
| public Join | getExpression()
Overrides org. Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| public String | Returns: The variable defining the join association pathReturns the name of the identification variable that defines the join association path. |
| public IdentificationVariableStateObject | Returns: The portion of the joining expression representing the identification variableReturns the state object holding the identification variable. |
| public StateObject | Returns: The root of the path expressionReturns the |
| public CollectionValuedPathExpressionStateObject | Returns: The state object representing the join association pathReturns the |
| public String | |
| public AbstractIdentificationVariableDeclarationStateObject | getParent()
Overrides org. Implements org. StateObject.
|
| public boolean | Returns: true if the AS identifier is part of the expression;
false otherwiseDetermines whether the |
| public boolean | Returns: true if the identifier FETCH was parsed; false otherwiseDetermines whether the identifier FETCH was parsed. |
| public boolean | Returns: true if the identification has been defined; false otherwiseDetermines whether the identification variable has been defined. |
| protected void | initialize()
Overrides org. |
| public boolean | isEquivalent(StateObject
The stateObject)StateObject to compare its content to this oneOverrides org. Implements org. StateObject is equivalent to this one, i.e. the
information of both StateObject is the same.
|
| public ListIterable | Returns: AnIterator over the segments of the state field pathReturns the segments in the state field path in order. |
| public int | Returns: The number of segmentsReturns the number of segments in the path expression. |
| public void | |
| public void | setAs(boolean
true if the AS identifier is part of the expression;
false otherwiseSets whether the |
| public void | setExpression(Join
The expression)parsed object representing a JOIN
expressionKeeps a reference of the |
| public void | setIdentificationVariable(String
The new variable defining the join association path identificationVariable)Sets the name of the identification variable that defines the join association path. |
| public void | setJoinAssociationIdentificationVariable(StateObject
The root of the path expression identificationVariable)Sets the |
| public void | setJoinAssociationPath(String
The new path expression path)Changes the path expression with the list of segments, the identification variable will also be updated with the first segment. |
| public void | setJoinAssociationPaths(ListIterator<String>
The new path expression paths)Changes the path expression with the list of segments, the identification variable will also be updated with the first segment. |
| public void | setJoinAssociationPaths(String[]
The new path expression paths)Changes the path expression with the list of segments, the identification variable will also be updated with the first segment. |
| public void | |
| public void | |
| protected void | toTextInternal(Appendable
The writer used to print out the string representation writer)Implements abstract org. StateObject, which should not be used to
define a true string representation of a JPQL query but should be used for
debugging purposes.
|
| protected void |
| as | back to summary |
|---|---|
| private boolean as Flag used to determine if the | |
| AS_PROPERTY | back to summary |
|---|---|
| public static final String AS_PROPERTY Notifies the visibility of the | |
| identificationVariable | back to summary |
|---|---|
| private IdentificationVariableStateObject identificationVariable The state object holding the identification variable. | |
| JOIN_TYPE_PROPERTY | back to summary |
|---|---|
| public static final String JOIN_TYPE_PROPERTY Notifies the join type property has changed. | |
| joinAssociationPath | back to summary |
|---|---|
| private CollectionValuedPathExpressionStateObject joinAssociationPath The state object holding the join association path. | |
| joinType | back to summary |
|---|---|
| private String joinType One of the joining types used by this state object. | |
| JoinStateObject | back to summary |
|---|---|
| public JoinStateObject(AbstractIdentificationVariableDeclarationStateObject parent, String joinType) Creates a new
| |
| JoinStateObject | back to summary |
|---|---|
| public JoinStateObject(AbstractIdentificationVariableDeclarationStateObject parent, String joinType, boolean as) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(StateObjectVisitor visitor) Implements org. Doc from org. Visits this
| |
| addAs | back to summary |
|---|---|
| public JoinStateObject addAs() Makes sure the
| |
| addChildren | back to summary |
|---|---|
| protected void addChildren(List<StateObject> children) Overrides org. Doc from org. Adds the children of this
| |
| addJoinAssociationPaths | back to summary |
|---|---|
| public void addJoinAssociationPaths(List<String> paths) Adds the given segments to the end of the join association path expression. The identification variable will not be affected. | |
| getExpression | back to summary |
|---|---|
| public Join getExpression() Overrides org. Implements org. Doc from org. Returns the actual parsed object if this
| |
| getIdentificationVariable | back to summary |
|---|---|
| public String getIdentificationVariable() Returns the name of the identification variable that defines the join association path.
| |
| getIdentificationVariableStateObject | back to summary |
|---|---|
| public IdentificationVariableStateObject getIdentificationVariableStateObject() Returns the state object holding the identification variable.
| |
| getJoinAssociationIdentificationVariable | back to summary |
|---|---|
| public StateObject getJoinAssociationIdentificationVariable() Returns the
| |
| getJoinAssociationPathStateObject | back to summary |
|---|---|
| public CollectionValuedPathExpressionStateObject getJoinAssociationPathStateObject() Returns the
| |
| getJoinType | back to summary |
|---|---|
| public String getJoinType() Returns the joining type.
| |
| getParent | back to summary |
|---|---|
| public AbstractIdentificationVariableDeclarationStateObject getParent() Overrides org. Implements org. Doc from org. Returns the parent of this
| |
| hasAs | back to summary |
|---|---|
| public boolean hasAs() Determines whether the
| |
| hasFetch | back to summary |
|---|---|
| public boolean hasFetch() Determines whether the identifier FETCH was parsed.
| |
| hasIdentificationVariable | back to summary |
|---|---|
| public boolean hasIdentificationVariable() Determines whether the identification variable has been defined.
| |
| initialize | back to summary |
|---|---|
| protected void initialize() Overrides org. Doc from org. Initializes this state object.
| |
| isEquivalent | back to summary |
|---|---|
| public boolean isEquivalent(StateObject stateObject) Overrides org. Implements org. Doc from org. Determines whether the given
| |
| joinAssociationPaths | back to summary |
|---|---|
| public ListIterable Returns the segments in the state field path in order.
| |
| joinAssociationPathSize | back to summary |
|---|---|
| public int joinAssociationPathSize() Returns the number of segments in the path expression.
| |
| removeNot | back to summary |
|---|---|
| public void removeNot() Makes sure the | |
| setAs | back to summary |
|---|---|
| public void setAs(boolean as) Sets whether the
| |
| setExpression | back to summary |
|---|---|
| public void setExpression(Join expression) Keeps a reference of the
| |
| setIdentificationVariable | back to summary |
|---|---|
| public void setIdentificationVariable(String identificationVariable) Sets the name of the identification variable that defines the join association path.
| |
| setJoinAssociationIdentificationVariable | back to summary |
|---|---|
| public void setJoinAssociationIdentificationVariable(StateObject identificationVariable) Sets the
| |
| setJoinAssociationPath | back to summary |
|---|---|
| public void setJoinAssociationPath(String path) Changes the path expression with the list of segments, the identification variable will also be updated with the first segment.
| |
| setJoinAssociationPaths | back to summary |
|---|---|
| public void setJoinAssociationPaths(ListIterator<String> paths) Changes the path expression with the list of segments, the identification variable will also be updated with the first segment.
| |
| setJoinAssociationPaths | back to summary |
|---|---|
| public void setJoinAssociationPaths(String[] paths) Changes the path expression with the list of segments, the identification variable will also be updated with the first segment.
| |
| setJoinType | back to summary |
|---|---|
| public void setJoinType(String joinType) Sets the joining type.
| |
| toggleAs | back to summary |
|---|---|
| public void toggleAs() Toggles the usage of the | |
| toTextInternal | back to summary |
|---|---|
| protected void toTextInternal(Appendable writer) throws IOException Implements abstract org. Doc from org. Prints out a string representation of this
| |
| validateJoinType | back to summary |
|---|---|
| protected void validateJoinType(String joinType) Validates the given join type.
| |