public class FromClauseStateObject extends AbstractFromClauseStateObject
FROM clause of a query defines the domain of the query by declaring
identification variables. An identification variable is an identifier declared in the
FROM clause of a query. The domain of the query may be constrained by path
expressions. Identification variables designate instances of a particular entity abstract schema
type. The FROM clause can contain multiple identification variable
declarations separated by a comma (,).
BNF: from_clause ::= FROM identification_variable_declaration {, {identification_variable_declaration | collection_member_declaration}}*CollectionMemberDeclarationStateObject,
IdentificationVariableDeclarationStateObject,
JoinStateObject,
SelectStatementStateObject,
FromClauseVARIABLE_DECLARATIONS_LIST| Constructor and Description |
|---|
FromClauseStateObject(SelectStatementStateObject parent)
Creates a new
FromClauseStateObject. |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(StateObjectVisitor visitor)
Visits this
StateObject by the given visitor. |
protected java.lang.String |
declarationBNF()
Returns the BNF of the declaration part of this clause.
|
IManagedType |
findManagedType(StateObject stateObject)
Returns the
IManagedType for the given identification variable. |
FromClause |
getExpression()
Returns the actual parsed object if this
StateObject representation of the JPQL query
was created by parsing an existing JPQL query. |
SelectStatementStateObject |
getParent()
Returns the parent of this
StateObject. |
void |
setExpression(FromClause expression)
Keeps a reference of the
parsed object object, which should only be done
when this object is instantiated during the conversion of a parsed JPQL query into StateObjects. |
addCollectionDeclaration, addCollectionDeclaration, addProblems, addRangeDeclaration, addRangeDeclaration, addRangeDeclaration, declarations, findIdentificationVariable, getDeclaration, getManagedType, identificationVariables, isEquivalent, listName, parse, toTextInternaladdChildren, addItem, addItems, addListChangeListener, areChildrenEquivalent, canMoveDown, canMoveUp, getItem, hasItems, initialize, items, itemsSize, moveDown, moveUp, removeItem, removeItems, removeListChangeListener, toStringItemsacceptUnknownVisitor, acceptUnknownVisitor, addPropertyChangeListener, areEquivalent, buildProblem, buildProblem, buildStateObject, buildStateObjects, checkParent, children, decorate, equals, firePropertyChanged, getChangeSupport, getDecorator, getGrammar, getManagedTypeProvider, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, isDecorated, parent, parent, parent, removePropertyChangeListener, setExpression, setParent, toString, toString, toStringInternal, toStringItems, toTextclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, children, decorate, getDecorator, getGrammar, getManagedTypeProvider, getQueryBuilder, getRoot, isDecorated, removePropertyChangeListener, setParent, toString, toTextpublic FromClauseStateObject(SelectStatementStateObject parent)
FromClauseStateObject.parent - The parent of this state object, which cannot be nulljava.lang.NullPointerException - The given parent cannot be nullpublic void accept(StateObjectVisitor visitor)
StateObject by the given visitor.visitor - The visitor to visit this objectprotected java.lang.String declarationBNF()
declarationBNF in class AbstractFromClauseStateObjectpublic IManagedType findManagedType(StateObject stateObject)
IManagedType for the given identification variable. If the declaration is
for a subquery and there is no managed type associated with the identification then the search
will traverse up the query hierarchy.
SELECT e FROM Department d JOIN KEY(d.employees).addresses a
In the above query, the managed type associated with the identification variable:
stateObject - The StateObject that should be an simple identification variable or
an encapsulated identification variable with the identifier KEY or
VALUEIManagedType representing the domain object declared by the given
identification variableDeclarationStateObject.getManagedType(StateObject)public FromClause getExpression()
StateObject representation of the JPQL query
was created by parsing an existing JPQL query.getExpression in interface StateObjectgetExpression in class AbstractFromClauseStateObjectStateObject
or null when the JPQL query is manually created (i.e. not from a string)public SelectStatementStateObject getParent()
StateObject.getParent in interface StateObjectgetParent in class AbstractFromClauseStateObjectStateObject, which is null only when
this is the root of the hierarchypublic void setExpression(FromClause expression)
parsed object object, which should only be done
when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.expression - The parsed object representing a FROM
expression