Package org.eclipse.persistence.jpa.jpql
Interface JPQLQueryDeclaration
- All Known Implementing Classes:
AbstractRangeDeclaration
,CollectionDeclaration
,Declaration
,DerivedDeclaration
,RangeDeclaration
,SubqueryDeclaration
,TableDeclaration
,UnknownDeclaration
public interface JPQLQueryDeclaration
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.
- Since:
- 2.4
- Version:
- 2.5
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
This enum type defines the various types of declarations supported by both the JPA functional specification and EclipseLink. -
Method Summary
Modifier and TypeMethodDescriptionReturns the range variable declaration if this is a range declaration otherwise the collection-valued path expression when this is a collection member declaration.Returns the declaration expression, which is either anIdentificationVariableDeclaration
or aCollectionMemberDeclaration
when part of a FROM clause, otherwise it's either theDeleteClause
or theUpdateClause
.getJoins()
Returns theJOIN
expressions defined with this declaration, if supported.getType()
Determines the type this declaration represents.Returns the identification variable name that is defining either the abstract schema name or the collection-valued path expressionboolean
hasJoins()
Determines whether the declaration contains JOIN expressions.
-
Method Details
-
getBaseExpression
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
Expression getDeclarationExpression()Returns the declaration expression, which is either anIdentificationVariableDeclaration
or aCollectionMemberDeclaration
when part of a FROM clause, otherwise it's either theDeleteClause
or theUpdateClause
.- Returns:
- The root of the declaration expression
-
getJoins
Returns theJOIN
expressions defined with this declaration, if supported. The list contains theJOIN
expressions in ordered they were declared.- Returns:
- The JOIN expressions defined with this declaration or an empty list if this declaration does not support it
-
getType
JPQLQueryDeclaration.Type getType()Determines the type this declaration represents.- Returns:
- One of the possible types
-
getVariableName
String getVariableName()Returns the identification variable name that is defining either the abstract schema name or the collection-valued path expression- Returns:
- The identification variable or an empty string if none was defined
-
hasJoins
boolean hasJoins()Determines whether the declaration contains JOIN expressions. This can betrue
only whenJPQLQueryDeclaration.Type.isRange()
returnstrue
. A collection member declaration does not have JOIN expressions.- Returns:
true
if at least one JOIN expression was parsed; otherwisefalse
-