public static class DeclarationResolver.Declaration extends java.lang.Object implements JPQLQueryDeclaration
Declaration represents either an identification variable declaration or a
collection member declaration. For a subquery, the declaration can be a derived path expression.| Modifier and Type | Field and Description |
|---|---|
protected Expression |
baseExpression
Either the range variable declaration if this is a range declaration otherwise the
collection-valued path expression when this is a collection member declaration.
|
protected Expression |
declarationExpression
The declaration expression, which is either an
IdentificationVariableDeclaration or
a CollectionMemberDeclaration when part of a FROM clause, otherwise it's
either the DeleteClause or the UpdateClause. |
protected boolean |
derived
Determines whether the "root" object is a derived path expression where the identification
variable is declared in the super query, otherwise it's an entity name.
|
protected IdentificationVariable |
identificationVariable
The identification variable used to declare an abstract schema name or a collection-valued
path expression.
|
protected java.util.Set<java.lang.String> |
joinIdentificationVariables
The identification variables that are defined in the JOIN expressions.
|
protected java.util.Map<Join,IdentificationVariable> |
joins
The list of JOIN expressions that are declared in the same declaration than the
range variable declaration.
|
protected boolean |
rangeDeclaration
Flag used to determine if this declaration is for a range variable declaration
(
true) or for a collection member declaration (false). |
protected java.lang.String |
rootPath
The "root" object for objects which may not be reachable by navigation, it is either the
abstract schema name (entity name), a derived path expression (which is only defined in a
subquery) or
null if this DeclarationResolver.Declaration is a collection member declaration. |
| Constructor and Description |
|---|
DeclarationResolver.Declaration() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addJoin(Join join,
IdentificationVariable identificationVariable)
Adds the given
Join with its identification variable, which can be null. |
protected java.util.Set<java.lang.String> |
buildJoinIdentificationVariables() |
protected java.util.Map.Entry<Join,java.lang.String> |
buildMapEntry(java.util.Map.Entry<Join,IdentificationVariable> entry) |
Expression |
getBaseExpression()
Returns the range variable declaration if this is a range declaration otherwise the
collection-valued path expression when this is a collection member declaration.
|
Expression |
getDeclarationExpression()
Returns the declaration expression, which is either an {@link org.eclipse.persistence.jpa.jpql.
|
java.util.List<java.util.Map.Entry<Join,java.lang.String>> |
getJoinEntries()
Returns the JOIN expressions mapped to their identification variables.
|
java.util.Set<java.lang.String> |
getJoinIdentificationVariables()
Returns the identification variables that are defined in the JOIN expressions.
|
java.util.List<Join> |
getJoins()
Returns the JOIN expressions that were part of the range variable declaration in the
ordered they were parsed.
|
java.lang.String |
getRootPath()
Returns the "root" object for objects which may not be reachable by navigation, it is
either the abstract schema name (entity name), a derived path expression (which is only
defined in a subquery) or
null if this DeclarationResolver.Declaration is a collection
member declaration. |
java.lang.String |
getSuperqueryVariableName()
If
isDerived() is true, then returns the identification variable used
in the derived path expression that is defined in the superquery, otherwise returns an
empty string. |
java.lang.String |
getVariableName()
Returns the identification variable name that is defining either the abstract schema name
or the collection-valued path expression
|
boolean |
hasJoins()
Determines whether the declaration contains JOIN expressions.
|
boolean |
isCollection()
Determines whether this
JPQLQueryDeclaration declaration represents a collection
member declaration or not. |
boolean |
isDerived()
Determines whether the "root" object is a derived path expression where the identification
variable is declared in the superquery, otherwise it's an entity name.
|
boolean |
isRange()
Determines whether this
DeclarationResolver.Declaration represents a range identification variable
declaration, example: "Employee e". |
protected void |
lockData()
Make sure the list of JOIN expressions and the map of JOIN FETCHS expressions
can not be modified.
|
java.lang.String |
toString() |
protected Expression baseExpression
protected Expression declarationExpression
IdentificationVariableDeclaration or
a CollectionMemberDeclaration when part of a FROM clause, otherwise it's
either the DeleteClause or the UpdateClause.protected boolean derived
protected IdentificationVariable identificationVariable
protected java.util.Set<java.lang.String> joinIdentificationVariables
protected java.util.Map<Join,IdentificationVariable> joins
protected boolean rangeDeclaration
true) or for a collection member declaration (false).protected java.lang.String rootPath
null if this DeclarationResolver.Declaration is a collection member declaration.protected void addJoin(Join join, IdentificationVariable identificationVariable)
Join with its identification variable, which can be null.join - identificationVariable - protected java.util.Set<java.lang.String> buildJoinIdentificationVariables()
protected java.util.Map.Entry<Join,java.lang.String> buildMapEntry(java.util.Map.Entry<Join,IdentificationVariable> entry)
public Expression getBaseExpression()
getBaseExpression in interface JPQLQueryDeclarationpublic Expression getDeclarationExpression()
parser.IdentificationVariableDeclaration IdentificationVariableDeclaration or a CollectionMemberDeclaration
when part of a FROM clause, otherwise it's either the jpa.jpql.parser.DeleteClause DeleteClause or the parser.UpdateClause UpdateClause.getDeclarationExpression in interface JPQLQueryDeclarationpublic java.util.List<java.util.Map.Entry<Join,java.lang.String>> getJoinEntries()
public java.util.Set<java.lang.String> getJoinIdentificationVariables()
public java.util.List<Join> getJoins()
getJoins in interface JPQLQueryDeclarationpublic java.lang.String getRootPath()
null if this DeclarationResolver.Declaration is a collection
member declaration.null if this DeclarationResolver.Declaration is a collection member declarationpublic java.lang.String getSuperqueryVariableName()
isDerived() is true, then returns the identification variable used
in the derived path expression that is defined in the superquery, otherwise returns an
empty string.public java.lang.String getVariableName()
getVariableName in interface JPQLQueryDeclarationpublic boolean hasJoins()
true only when JPQLQueryDeclaration.isRange() returns true. A collection
member declaration does not have JOIN expressions.hasJoins in interface JPQLQueryDeclarationtrue if at least one JOIN expression was parsed;
otherwise falsepublic boolean isCollection()
JPQLQueryDeclaration declaration represents a collection
member declaration or not.isCollection in interface JPQLQueryDeclarationtrue if this is a collection member declaration; false
otherwisepublic boolean isDerived()
isDerived in interface JPQLQueryDeclarationtrue if the root path is a derived path expression; false
otherwisepublic boolean isRange()
DeclarationResolver.Declaration represents a range identification variable
declaration, example: "Employee e".isRange in interface JPQLQueryDeclarationtrue if the declaration is over an abstract schema name; false
if it's over a collection-valued path expressionisDerived()protected void lockData()
public java.lang.String toString()
toString in class java.lang.Object