Top Description Inners Methods
org.eclipse.persistence.jpa.jpql

public Interface JPQLQueryDeclaration

Known Direct Implementers
org.eclipse.persistence.jpa.jpql.tools.resolver.Declaration
Imports
java.util.List, org.eclipse.persistence.jpa.jpql.parser.Expression, .Join

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

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Author
Pascal Filion
Since
2.4
Version
2.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
JPQLQueryDeclaration.Type

This enum type defines the various types of declarations supported by both the JPA functional specification and EclipseLink.

Method Summary

Modifier and TypeMethod and Description
public Expression

Returns:

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

public Expression

Returns:

The root of the 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.

public List<Join>

Returns:

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

Returns the JOIN expressions defined with this declaration, if supported.

public JPQLQueryDeclaration.Type

Returns:

One of the possible types
getType
()

Determines the type this declaration represents.

public String

Returns:

The identification variable or an empty string if none was defined
getVariableName
()

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

public boolean

Returns:

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

Determines whether the declaration contains JOIN expressions.

Method Detail

getBaseExpressionback to summary
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:Expression

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

getDeclarationExpressionback to summary
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:Expression

The root of the declaration expression

getJoinsback to summary
public List<Join> 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

getTypeback to summary
public JPQLQueryDeclaration.Type getType()

Determines the type this declaration represents.

Returns:JPQLQueryDeclaration.Type

One of the possible types

getVariableNameback to summary
public String 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

hasJoinsback to summary
public boolean 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

org.eclipse.persistence.jpa.jpql back to summary

public final Enum JPQLQueryDeclaration.Type

extends Enum<JPQLQueryDeclaration.Type>
Class Inheritance

This enum type defines the various types of declarations supported by both the JPA functional specification and EclipseLink.

Field Summary

Modifier and TypeField and Description
public static final JPQLQueryDeclaration.Type
CLASS_NAME

Indicates the "root" object maps a fully qualified class name.

public static final JPQLQueryDeclaration.Type
COLLECTION

Indicates the "root" object maps a collection-valued path expression.

public static final JPQLQueryDeclaration.Type
DERIVED

Indicates the "root" object is a derived path expression where the identification variable is declared in the super query, otherwise it's an entity name.

public static final JPQLQueryDeclaration.Type
RANGE

Indicates the "root" object maps to an entity.

private boolean
range

Flag used to determine if the type represents a range variable declaration.

public static final JPQLQueryDeclaration.Type
SUBQUERY

Indicates the "root" object maps to a subquery.

public static final JPQLQueryDeclaration.Type
TABLE

Indicates the "root" object maps directly to a database table.

public static final JPQLQueryDeclaration.Type
UNKNOWN

Indicates the "root" object maps to an unknown expression.

Constructor Summary

AccessConstructor and Description
private
Type(boolean range)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this constant represents a range variable declaration; false otherwise
isRange
()

Determines whether this type represents a range variable declaration.

public static JPQLQueryDeclaration.Type
public static JPQLQueryDeclaration.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CLASS_NAMEback to summary
public static final JPQLQueryDeclaration.Type CLASS_NAME

Indicates the "root" object maps a fully qualified class name.

COLLECTIONback to summary
public static final JPQLQueryDeclaration.Type COLLECTION

Indicates the "root" object maps a collection-valued path expression.

DERIVEDback to summary
public static final JPQLQueryDeclaration.Type DERIVED

Indicates the "root" object is a derived path expression where the identification variable is declared in the super query, otherwise it's an entity name.

RANGEback to summary
public static final JPQLQueryDeclaration.Type RANGE

Indicates the "root" object maps to an entity.

rangeback to summary
private boolean range

Flag used to determine if the type represents a range variable declaration.

SUBQUERYback to summary
public static final JPQLQueryDeclaration.Type SUBQUERY

Indicates the "root" object maps to a subquery.

TABLEback to summary
public static final JPQLQueryDeclaration.Type TABLE

Indicates the "root" object maps directly to a database table.

UNKNOWNback to summary
public static final JPQLQueryDeclaration.Type UNKNOWN

Indicates the "root" object maps to an unknown expression.

Constructor Detail

Typeback to summary
private Type(boolean range)

Method Detail

isRangeback to summary
public boolean isRange()

Determines whether this type represents a range variable declaration.

Returns:boolean

true if this constant represents a range variable declaration; false otherwise

valueOfback to summary
public static JPQLQueryDeclaration.Type valueOf(String name)
valuesback to summary
public static JPQLQueryDeclaration.Type[] values()