Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.jpql

pack-priv abstract Class Declaration

extends Object
implements JPQLQueryDeclaration
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration
Known Direct Subclasses
org.eclipse.persistence.internal.jpa.jpql.JoinDeclaration, org.eclipse.persistence.internal.jpa.jpql.SubqueryDeclaration, org.eclipse.persistence.internal.jpa.jpql.TableDeclaration, org.eclipse.persistence.internal.jpa.jpql.AbstractRangeDeclaration, org.eclipse.persistence.internal.jpa.jpql.CollectionDeclaration
Imports
java.util.Collections, .List, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.jpa.jpql.ExpressionTools, .JPQLQueryDeclaration, org.eclipse.persistence.jpa.jpql.parser.AbstractExpression, .Expression, .IdentificationVariable, .Join, org.eclipse.persistence.mappings.DatabaseMapping

A Declaration is the corresponding representation of a single declaration defined in the FROM clause of a query.
Author
Pascal Filion
Since
2.4
Version
2.5

Field Summary

Modifier and TypeField and Description
pack-priv Expression
pack-priv 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.

private ClassDescriptor
descriptor

The cached ClassDescriptor that represents this Declaration's "root" path.

pack-priv IdentificationVariable
identificationVariable

The IdentificationVariable used to declare a "root" object.

private DatabaseMapping
mapping

The cached DatabaseMapping if this Declaration's "root" path points to a mapping, otherwise it will be null.

pack-priv final JPQLQueryContext
queryContext

The JPQLQueryContext is used to query information about the application metadata and cached information.

private Expression
queryExpression

The Expression representing the information of this Declaration.

pack-priv 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 Declaration is a collection member declaration.

Constructor Summary

AccessConstructor and Description
pack-priv
Declaration(JPQLQueryContext
The context used to query information about the application metadata and cached information
queryContext
)

Creates a new Declaration.

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract Expression

Returns:

A new Expression
buildQueryExpression
()

Creates the Expression Expression for this Declaration.

public Expression
getBaseExpression()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.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.
public Expression
getDeclarationExpression()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.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.
pack-priv final ClassDescriptor

Returns:

The descriptor of the "root" path
getDescriptor
()

Returns the ClassDescriptor that represents this Declaration's "root" path.

public List<Join>
getJoins()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.getJoins.

Returns the JOIN expressions defined with this declaration, if supported.
pack-priv final DatabaseMapping

Returns:

Either the DatabaseMapping of the "root" path, or null if the "root" path is not a mapping
getMapping
()

Returns the DatabaseMapping that this Declaration represents, which may be null in the case it does not represent one.

pack-priv final Expression

Returns:

The Expression representing the information of this Declaration
getQueryExpression
()

Returns the Expression Expression for this Declaration.

public final String
getVariableName()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.getVariableName.

Returns the identification variable name that is defining either the abstract schema name or the collection-valued path expression
public boolean
hasJoins()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.hasJoins.

Determines whether the declaration contains JOIN expressions.
pack-priv abstract ClassDescriptor

Returns:

The descriptor associated with this declaration
resolveDescriptor
()

Resolves this Declaration and returns the associated ClassDescriptor.

pack-priv abstract DatabaseMapping

Returns:

The mapping associated with this declaration
resolveMapping
()

Resolves this Declaration and returns the associated DatabaseMapping if this represents a path expression.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

baseExpressionback to summary
pack-priv Expression baseExpression

TODO.

declarationExpressionback to summary
pack-priv 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.

descriptorback to summary
private ClassDescriptor descriptor

The cached ClassDescriptor that represents this Declaration's "root" path.

identificationVariableback to summary
pack-priv IdentificationVariable identificationVariable

The IdentificationVariable used to declare a "root" object.

mappingback to summary
private DatabaseMapping mapping

The cached DatabaseMapping if this Declaration's "root" path points to a mapping, otherwise it will be null.

queryContextback to summary
pack-priv final JPQLQueryContext queryContext

The JPQLQueryContext is used to query information about the application metadata and cached information.

queryExpressionback to summary
private Expression queryExpression

The Expression representing the information of this Declaration.

rootPathback to summary
pack-priv 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 Declaration is a collection member declaration.

Constructor Detail

Declarationback to summary
pack-priv Declaration(JPQLQueryContext queryContext)

Creates a new Declaration.

Parameters
queryContext:JPQLQueryContext

The context used to query information about the application metadata and cached information

Method Detail

buildQueryExpressionback to summary
pack-priv abstract Expression buildQueryExpression()

Creates the Expression Expression for this Declaration.

Returns:Expression

A new Expression

getBaseExpressionback to summary
public Expression getBaseExpression()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.getBaseExpression.

Doc from org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.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:Expression

Either the range variable declaration or the collection-valued path expression

Annotations
@Override
getDeclarationExpressionback to summary
public Expression getDeclarationExpression()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.getDeclarationExpression.

Doc from org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.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:Expression

The root of the declaration expression

Annotations
@Override
getDescriptorback to summary
pack-priv final ClassDescriptor getDescriptor()

Returns the ClassDescriptor that represents this Declaration's "root" path.

Returns:ClassDescriptor

The descriptor of the "root" path

getJoinsback to summary
public List<Join> getJoins()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.getJoins.

Doc from org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.getJoins.

Returns the JOIN expressions defined with this declaration, if supported. The list contains the JOIN expressions in ordered they were declared.

Returns:List<Join>

The JOIN expressions defined with this declaration or an empty list if this declaration does not support it

Annotations
@Override
getMappingback to summary
pack-priv final DatabaseMapping getMapping()

Returns the DatabaseMapping that this Declaration represents, which may be null in the case it does not represent one.

Returns:DatabaseMapping

Either the DatabaseMapping of the "root" path, or null if the "root" path is not a mapping

getQueryExpressionback to summary
pack-priv final Expression getQueryExpression()

Returns the Expression Expression for this Declaration.

Returns:Expression

The Expression representing the information of this Declaration

getVariableNameback to summary
public final String getVariableName()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.getVariableName.

Doc from org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.getVariableName.

Returns the identification variable name that is defining either the abstract schema name or the collection-valued path expression

Returns:String

The identification variable or an empty string if none was defined

Annotations
@Override
hasJoinsback to summary
public boolean hasJoins()

Implements org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.hasJoins.

Doc from org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration.hasJoins.

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

Returns:boolean

true if at least one JOIN expression was parsed; otherwise false

Annotations
@Override
resolveDescriptorback to summary
pack-priv abstract ClassDescriptor resolveDescriptor()

Resolves this Declaration and returns the associated ClassDescriptor. For a org.eclipse.persistence.jpa.jpql.parser.RangeVariableDeclaration, this will return the actual descriptor for the entity. For a mapping, this will return the reference descriptor.

Returns:ClassDescriptor

The descriptor associated with this declaration

resolveMappingback to summary
pack-priv abstract DatabaseMapping resolveMapping()

Resolves this Declaration and returns the associated DatabaseMapping if this represents a path expression. In the case of a org.eclipse.persistence.jpa.jpql.parser.RangeVariableDeclaration, this will return null.

Returns:DatabaseMapping

The mapping associated with this declaration

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override