Class Declaration
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.Declaration
-
- All Implemented Interfaces:
JPQLQueryDeclaration
- Direct Known Subclasses:
AbstractRangeDeclaration,CollectionDeclaration,SubqueryDeclaration,TableDeclaration,UnknownDeclaration
public abstract class Declaration extends Object implements JPQLQueryDeclaration
The abstract definition ofJPQLQueryDeclaration.- Since:
- 2.5
- Version:
- 2.5
- Author:
- Pascal Filion
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration
JPQLQueryDeclaration.Type
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExpressiongetBaseExpression()Returns the range variable declaration if this is a range declaration otherwise the collection-valued path expression when this is a collection member declaration.ExpressiongetDeclarationExpression()Returns the declaration expression, which is either anIdentificationVariableDeclarationor aCollectionMemberDeclarationwhen part of a FROM clause, otherwise it's either theDeleteClauseor theUpdateClause.IdentificationVariablegetIdentificationVariable()Returns theIdentificationVariableused to declare the "root" object.List<Join>getJoins()Returns theJOINexpressions defined with this declaration, if supported.StringgetRootPath()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) ornullif thisDeclarationis a collection member declaration.StringgetVariableName()Returns the identification variable name that is defining either the abstract schema name or the collection-valued path expressionbooleanhasJoins()Determines whether the declaration contains JOIN expressions.StringtoString()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration
getType
-
-
-
-
Method Detail
-
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:
getBaseExpressionin interfaceJPQLQueryDeclaration- Returns:
- Either the range variable declaration or the collection-valued path expression
-
getDeclarationExpression
public Expression getDeclarationExpression()
Returns the declaration expression, which is either anIdentificationVariableDeclarationor aCollectionMemberDeclarationwhen part of a FROM clause, otherwise it's either theDeleteClauseor theUpdateClause.- Specified by:
getDeclarationExpressionin interfaceJPQLQueryDeclaration- Returns:
- The root of the declaration expression
-
getIdentificationVariable
public IdentificationVariable getIdentificationVariable()
Returns theIdentificationVariableused to declare the "root" object.- Returns:
- The alias for the "root" object
-
getJoins
public List<Join> getJoins()
Returns theJOINexpressions defined with this declaration, if supported. The list contains theJOINexpressions in ordered they were declared.- Specified by:
getJoinsin interfaceJPQLQueryDeclaration- Returns:
- The JOIN expressions defined with this declaration or an empty list if this declaration does not support it
-
getRootPath
public 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) ornullif thisDeclarationis a collection member declaration.- Returns:
- The "root" object for objects which may not be reachable by navigation or
nullif thisDeclarationis a collection member declaration
-
getVariableName
public String getVariableName()
Returns the identification variable name that is defining either the abstract schema name or the collection-valued path expression- Specified by:
getVariableNamein interfaceJPQLQueryDeclaration- Returns:
- The identification variable or an empty string if none was defined
-
hasJoins
public boolean hasJoins()
Determines whether the declaration contains JOIN expressions. This can betrueonly whenJPQLQueryDeclaration.Type.isRange()returnstrue. A collection member declaration does not have JOIN expressions.- Specified by:
hasJoinsin interfaceJPQLQueryDeclaration- Returns:
trueif at least one JOIN expression was parsed; otherwisefalse
-
-