Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


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

java.lang.Object
  extended by org.eclipse.persistence.jpa.internal.jpql.DeclarationResolver.Declaration

Enclosing class:
DeclarationResolver

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

A Declaration represents either an identification variable declaration or a collection member declaration.


Field Summary
(package private)  java.lang.String abstractSchemaName
          The abstract schema name, which is the entity name or null if this DeclarationResolver.Declaration is a collection member declaration.
(package private)  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.
(package private)  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.
(package private)  IdentificationVariable identificationVariable
          The identification variable used to declare an abstract schema name or a collection-valued path expression.
(package private)  java.util.List<JoinFetch> joinFetches
          The list of JOIN FETCH expressions that are declared in the same declaration than the range variable declaration.
(package private)  java.util.Set<java.lang.String> joinIdentificationVariables
          The identification variables that are defined in the JOIN expressions.
(package private)  java.util.Map<Join,IdentificationVariable> joins
          The list of JOIN expressions that are declared in the same declaration than the range variable declaration.
(package private)  boolean rangeDeclaration
          Flag used to determine if this declaration is for a range variable declaration (true) or for a collection member declaration (false).

 

Constructor Summary
DeclarationResolver.Declaration()
           

 

Method Summary
private  void addJoin(Join join, IdentificationVariable identificationVariable)
           
private  void addJoinFetch(JoinFetch joinFetch)
           
private  java.util.Set<java.lang.String> buildJoinIdentificationVariables()
           
private  java.util.Map.Entry<Join,java.lang.String> buildMapEntry(java.util.Map.Entry<Join,IdentificationVariable> entry)
           
 java.lang.String getAbstractSchemaName()
          Returns the abstract schema name, which is the entity name.
 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 IdentificationVariableDeclaration or a CollectionMemberDeclaration when part of a FROM clause, otherwise it's either the DeleteClause or the UpdateClause.
 java.util.List<java.util.Map.Entry<Join,java.lang.String>> getJoinEntries()
          Returns the JOIN expressions mapped to their identification variables.
 java.util.List<JoinFetch> getJoinFetches()
          Returns the JOIN FETCH expressions that were part of the range variable declaration in the ordered they were parsed.
 java.util.Set<java.lang.String> getJoinIdentificationVariables()
          Returns the identification variables that are defined in the JOIN expressions.
 java.util.Collection<Join> getJoins()
          Returns the JOIN expressions that were part of the range variable declaration in the ordered they were parsed.
 java.lang.String getVariableName()
          Returns the identification variable name that is defining either the abstract schema name or the collection-valued path expression
 boolean hasJoinFetches()
          Determines whether the declaration contains JOIN FETCH expressions.
 boolean hasJoins()
          Determines whether the declaration contains JOIN expressions.
 boolean isRange()
          Determines whether this DeclarationResolver.Declaration represents a range identification variable declaration, example: "Employee e".
private  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

abstractSchemaName

java.lang.String abstractSchemaName
The abstract schema name, which is the entity name or null if this DeclarationResolver.Declaration is a collection member declaration.

baseExpression

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

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.

identificationVariable

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

joinFetches

java.util.List<JoinFetch> joinFetches
The list of JOIN FETCH expressions that are declared in the same declaration than the range variable declaration.

joinIdentificationVariables

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

joins

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

rangeDeclaration

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

Constructor Detail

DeclarationResolver.Declaration

public DeclarationResolver.Declaration()

Method Detail

addJoin

private void addJoin(Join join,
                     IdentificationVariable identificationVariable)

addJoinFetch

private void addJoinFetch(JoinFetch joinFetch)

buildJoinIdentificationVariables

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

buildMapEntry

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

getAbstractSchemaName

public java.lang.String getAbstractSchemaName()
Returns the abstract schema name, which is the entity name.
Returns:
The abstract schema name, which is the entity name or null if this DeclarationResolver.Declaration is a collection member declaration

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.
Returns:
Either the range variable declaration or the collection-valued path expression

getDeclarationExpression

public Expression getDeclarationExpression()
Returns 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.
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

getJoinFetches

public java.util.List<JoinFetch> getJoinFetches()
Returns the JOIN FETCH expressions that were part of the range variable declaration in the ordered they were parsed.
Returns:
The ordered list of JOIN FETCH expressions or an empty collection if none was present

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.Collection<Join> getJoins()
Returns the JOIN expressions that were part of the range variable declaration in the ordered they were parsed.
Returns:
The ordered list of JOIN expressions or an empty collection if none was present

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
Returns:
The name of the identification variable

hasJoinFetches

public boolean hasJoinFetches()
Determines whether the declaration contains JOIN FETCH expressions. This can be true only when isRange() returns true. A collection member declaration does not have JOIN FETCH expressions.
Returns:
true if at least one JOIN FETCH expression was parsed; otherwise false

hasJoins

public boolean hasJoins()
Determines whether the declaration contains JOIN expressions. This can be true only when isRange() returns true. A collection member declaration does not have JOIN expressions.
Returns:
true if at least one JOIN expression was parsed; otherwise false

isRange

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

Note: There is a case where this can be true but the range expression is not an abstract schema name but a derived path. It only happens in a subquery defined in the WHERE clause of an UPDATE or DELETE statement because the identification variable is optional.

Returns:
true if the declaration is over an abstract schema name; false if it's over a collection-valued path expression

lockData

private 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

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.