|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.eclipse.persistence.jpa.internal.jpql.parser.StringExpression
org.eclipse.persistence.jpa.internal.jpql.parser.AbstractExpression
org.eclipse.persistence.jpa.internal.jpql.parser.RangeVariableDeclaration
public final class RangeVariableDeclaration
Range variable declarations allow the developer to designate a "root" for objects which may not be reachable by navigation. In order to select values by comparing more than one instance of an entity abstract schema type, more than one identification variable ranging over the abstract schema type is needed in the FROM clause.
range_variable_declaration ::= abstract_schema_name [AS] identification_variable
Field Summary | |
---|---|
private AbstractExpression |
abstractSchemaName The Expression representing the abstract schema name. |
private boolean |
hasAs Determines whether the identifier AS was parsed. |
private boolean |
hasSpaceAfterAs Determines whether a whitespace was parsed after AS. |
private boolean |
hasSpaceAfterSchemaName Determines whether a whitespace was parsed after the abstract schema name. |
private AbstractExpression |
identificationVariable The Expression representing the identification variable. |
private boolean |
virtualIdentificationVariable Determines whether the identification variable is virtual, meaning it's not part of the query but is required for proper navigability. |
Fields inherited from class org.eclipse.persistence.jpa.internal.jpql.parser.AbstractExpression |
---|
COMMA, DOT, DOUBLE_QUOTE, LEFT_CURLY_BRACKET, LEFT_PARENTHESIS, NOT_DEFINED, RIGHT_CURLY_BRACKET, RIGHT_PARENTHESIS, SINGLE_QUOTE, SPACE, UNDERSCORE |
Constructor Summary | |
---|---|
RangeVariableDeclaration(AbstractExpression parent) Creates a new RangeVariableDeclaration . |
Method Summary | |
---|---|
void |
accept(ExpressionVisitor visitor) Visits this Expression by the given visitor . |
void |
acceptChildren(ExpressionVisitor visitor) Visits the children of this Expression . |
(package private) void |
addChildrenTo(java.util.Collection<Expression> children) Adds the children of this Expression to the given collection. |
(package private) void |
addOrderedChildrenTo(java.util.List<StringExpression> children) Adds the StringExpressions representing this Expression . |
Expression |
getAbstractSchemaName() Returns the Expression that represents the abstract schema name. |
Expression |
getIdentificationVariable() Returns the Expression that represents the identification variable. |
JPQLQueryBNF |
getQueryBNF() Returns the BNF of this Expression . |
boolean |
hasAbstractSchemaName() Determines whether the abstract schema name was parsed. |
boolean |
hasAs() Determines whether the identifier AS was parsed. |
boolean |
hasIdentificationVariable() Determines whether the identification variable was parsed. |
boolean |
hasSpaceAfterAbstractSchemaName() Determines whether a whitespace was parsed after the abstract schema name. |
boolean |
hasSpaceAfterAs() Determines whether a whitespace was parsed after AS. |
boolean |
hasVirtualIdentificationVariable() Determines whether this identification variable is virtual, meaning it's not part of the query but is required for proper navigability. |
(package private) boolean |
isParsingComplete(WordParser wordParser, java.lang.String word, Expression expression) Determines whether the parsing is complete based on what is left in the given text. |
(package private) void |
parse(WordParser wordParser, boolean tolerant) Parses the query by starting at the current position, which is part of the given WordParser . |
private AbstractExpression |
parseAbstractSchemaName(WordParser wordParser, boolean tolerant) |
private AbstractExpression |
parseIdentificationVariable(WordParser wordParser, boolean tolerant) |
(package private) void |
setDeclaration(java.lang.String abstractSchemaName, java.lang.String identificationVariable) Manually sets the abstract schema name and identification variable. |
(package private) void |
setVirtualIdentificationVariable(java.lang.String variableName) Sets a virtual identification variable because the abstract schema name was parsed without one. |
void |
setVirtualIdentificationVariable(java.lang.String variableName, java.lang.String path) Sets a virtual identification variable because the abstract schema name was parsed without one. |
(package private) boolean |
shouldParseWithFactoryFirst() TODO |
(package private) void |
toParsedText(java.lang.StringBuilder writer, boolean includeVirtual) Generates a string representation of this Expression . |
Methods inherited from class org.eclipse.persistence.jpa.internal.jpql.parser.AbstractExpression |
---|
buildExpressionFromFallingBack, buildNullExpression, buildStringExpression, buildStringExpression, buildUnknownExpression, children, expressionFactory, expressionFactoryForIdentifier, findQueryBNF, getChildren, getJPAVersion, getParent, getRoot, getText, handleAggregate, identifierRole, identifiers, identifiers, identifierVersion, isAncestor, isIdentifier, isNull, isTolerant, isUnknown, isVirtual, orderedChildren, parse, parseSingleExpression, populatePosition, queryBNF, readdLeadingSpaces, rebuildActualText, rebuildParsedText, setParent, setText, shouldSkipLiteral, toActualText, toParsedText, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private AbstractExpression abstractSchemaName
Expression
representing the abstract schema name.private boolean hasAs
private boolean hasSpaceAfterAs
private boolean hasSpaceAfterSchemaName
private AbstractExpression identificationVariable
Expression
representing the identification variable.private boolean virtualIdentificationVariable
Constructor Detail |
---|
RangeVariableDeclaration(AbstractExpression parent)
RangeVariableDeclaration
.
parent
- The parent of this expressionMethod Detail |
---|
public void accept(ExpressionVisitor visitor)
Expression
by the given visitor
.visitor
- The visitor
to visit this objectpublic void acceptChildren(ExpressionVisitor visitor)
Expression
. This method can be used to optimize traversing the children since a new list is not created every time Expression.children()
or Expression.getChildren()
is called.
This does not traverse the Expression
sub-hierarchy, use an subclass of AbstractTraverseChildrenVisitor
in order to traverse the entire sub-hierarchy.
visitor
- The visitor
to visit the children of this object.void addChildrenTo(java.util.Collection<Expression> children)
Expression
to the given collection.addChildrenTo
in class AbstractExpression
children
- The collection used to store the childrenvoid addOrderedChildrenTo(java.util.List<StringExpression> children)
StringExpressions
representing this Expression
.addOrderedChildrenTo
in class AbstractExpression
children
- The list used to store the string representation of this Expression
public Expression getAbstractSchemaName()
Expression
that represents the abstract schema name.public Expression getIdentificationVariable()
Expression
that represents the identification variable.public JPQLQueryBNF getQueryBNF()
Expression
.getQueryBNF
in class AbstractExpression
JPQLQueryBNF
, which represents the grammar of this Expression
public boolean hasAbstractSchemaName()
true
if the abstract schema name was parsed; false
otherwisepublic boolean hasAs()
true
if the identifier AS was parsed; false
otherwisepublic boolean hasIdentificationVariable()
true
if the identification variable was parsed; false
otherwisepublic boolean hasSpaceAfterAbstractSchemaName()
true
if there was a whitespace after the abstract schema name; false
otherwisepublic boolean hasSpaceAfterAs()
true
if there was a whitespace after AS; false
otherwisepublic boolean hasVirtualIdentificationVariable()
true
if this identification variable was virtually created to fully qualify path expression; false
if it was parsedboolean isParsingComplete(WordParser wordParser, java.lang.String word, Expression expression)
isParsingComplete
in class AbstractExpression
wordParser
- The text to parse based on the current position of the cursorword
- The word that was retrieved from the given text, which is the first word in the textexpression
- The Expression
that has already been parsedtrue
if the text no longer can't be parsed by the current expression; false
if more can be parsedvoid parse(WordParser wordParser, boolean tolerant)
WordParser
.parse
in class AbstractExpression
wordParser
- The text to parse based on the current position of the cursortolerant
- Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queriesprivate AbstractExpression parseAbstractSchemaName(WordParser wordParser, boolean tolerant)
private AbstractExpression parseIdentificationVariable(WordParser wordParser, boolean tolerant)
void setDeclaration(java.lang.String abstractSchemaName, java.lang.String identificationVariable)
abstractSchemaName
- The abstract schema name to be mapped to the given variableidentificationVariable
- The identification variable mapping the given schema namevoid setVirtualIdentificationVariable(java.lang.String variableName)
variableName
- The identification variable that was generated to identify the abstract schema namepublic void setVirtualIdentificationVariable(java.lang.String variableName, java.lang.String path)
variableName
- The identification variable that was generated to identify the abstract schema namepath
- The path that was parsed as an abstract schema nameboolean shouldParseWithFactoryFirst()
shouldParseWithFactoryFirst
in class AbstractExpression
void toParsedText(java.lang.StringBuilder writer, boolean includeVirtual)
Expression
.toParsedText
in class AbstractExpression
writer
- The buffer used to append this Expression
's string representationincludeVirtual
- Determines whether to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |