EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql
Class DeclarationResolver.Declaration

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.DeclarationResolver.Declaration
All Implemented Interfaces:
JPQLQueryDeclaration
Enclosing class:
DeclarationResolver

public static class DeclarationResolver.Declaration
extends java.lang.Object
implements JPQLQueryDeclaration

A Declaration represents either an identification variable declaration or a collection member declaration. For a subquery, the declaration can be a derived path expression.


Field Summary
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 Summary
DeclarationResolver.Declaration()
           
 
Method Summary
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()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

baseExpression

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.


declarationExpression

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.


derived

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.


identificationVariable

protected IdentificationVariable identificationVariable
The identification variable used to declare an abstract schema name or a collection-valued path expression.


joinIdentificationVariables

protected java.util.Set<java.lang.String> joinIdentificationVariables
The identification variables that are defined in the JOIN expressions.


joins

protected java.util.Map<Join,IdentificationVariable> joins
The list of JOIN expressions that are declared in the same declaration than the range variable declaration.


rangeDeclaration

protected boolean rangeDeclaration
Flag used to determine if this declaration is for a range variable declaration (true) or for a collection member declaration (false).


rootPath

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 Detail

DeclarationResolver.Declaration

public DeclarationResolver.Declaration()
Method Detail

addJoin

protected void addJoin(Join join,
                       IdentificationVariable identificationVariable)
Adds the given Join with its identification variable, which can be null.

Parameters:
join -
identificationVariable -

buildJoinIdentificationVariables

protected java.util.Set<java.lang.String> buildJoinIdentificationVariables()

buildMapEntry

protected java.util.Map.Entry<Join,java.lang.String> buildMapEntry(java.util.Map.Entry<Join,IdentificationVariable> entry)

getBaseExpression

public 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.

Specified by:
getBaseExpression in interface JPQLQueryDeclaration
Returns:
Either the range variable declaration or the collection-valued path expression

getDeclarationExpression

public Expression getDeclarationExpression()
Returns the declaration expression, which is either an 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.

Specified by:
getDeclarationExpression in interface JPQLQueryDeclaration
Returns:
The root of the declaration expression

getJoinEntries

public java.util.List<java.util.Map.Entry<Join,java.lang.String>> getJoinEntries()
Returns the JOIN expressions mapped to their identification variables. The set returns the JOIN expressions in ordered they were parsed.

Returns:
The JOIN expressions mapped to their identification variables

getJoinIdentificationVariables

public java.util.Set<java.lang.String> getJoinIdentificationVariables()
Returns the identification variables that are defined in the JOIN expressions.

Returns:
The identification variables that are defined in the JOIN expressions

getJoins

public java.util.List<Join> getJoins()
Returns the JOIN expressions that were part of the range variable declaration in the ordered they were parsed.

Specified by:
getJoins in interface JPQLQueryDeclaration
Returns:
The ordered list of JOIN expressions or an empty collection if none was present

getRootPath

public 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.

Returns:
The "root" object for objects which may not be reachable by navigation or null if this DeclarationResolver.Declaration is a collection member declaration

getSuperqueryVariableName

public 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.

Returns:
The identification variable from the superquery if the root path is a derived path expression

getVariableName

public java.lang.String getVariableName()
Returns the identification variable name that is defining either the abstract schema name or the collection-valued path expression

Specified by:
getVariableName in interface JPQLQueryDeclaration
Returns:
The name of the identification variable

hasJoins

public boolean hasJoins()
Determines whether the declaration contains JOIN expressions. This can be true only when JPQLQueryDeclaration.isRange() returns true. A collection member declaration does not have JOIN expressions.

Specified by:
hasJoins in interface JPQLQueryDeclaration
Returns:
true if at least one JOIN expression was parsed; otherwise false

isCollection

public boolean isCollection()
Determines whether this JPQLQueryDeclaration declaration represents a collection member declaration or not.

Specified by:
isCollection in interface JPQLQueryDeclaration
Returns:
true if this is a collection member declaration; false otherwise

isDerived

public 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.

Specified by:
isDerived in interface JPQLQueryDeclaration
Returns:
true if the root path is a derived path expression; false otherwise

isRange

public boolean isRange()
Determines whether this DeclarationResolver.Declaration represents a range identification variable declaration, example: "Employee e".

Specified by:
isRange in interface JPQLQueryDeclaration
Returns:
true if the declaration is over an abstract schema name; false if it's over a collection-valued path expression
See Also:
isDerived()

lockData

protected void lockData()
Make sure the list of JOIN expressions and the map of JOIN FETCHS expressions can not be modified.


toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference