|
EclipseLink 2.4.1, build 'v20121003-ad44345' API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.persistence.jpa.jpql.model.query.AbstractStateObject
org.eclipse.persistence.jpa.jpql.model.query.AbstractListHolderStateObject<VariableDeclarationStateObject>
org.eclipse.persistence.jpa.jpql.model.query.AbstractFromClauseStateObject
org.eclipse.persistence.jpa.jpql.model.query.SimpleFromClauseStateObject
public class SimpleFromClauseStateObject
The FROM clause of a sub-query defines the domain of the sub-query by
declaring identification variables. An identification variable is an identifier declared in the
FROM clause of a sub-query. The domain of the sub-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: subquery_from_clause ::= FROM subselect_identification_variable_declaration {, subselect_identification_variable_declaration}*
SimpleFromClause| Field Summary |
|---|
| Fields inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractFromClauseStateObject |
|---|
VARIABLE_DECLARATIONS_LIST |
| Constructor Summary | |
|---|---|
SimpleFromClauseStateObject(SimpleSelectStatementStateObject parent)
Creates a new SimpleFromClauseStateObject. |
|
| Method Summary | |
|---|---|
void |
accept(StateObjectVisitor visitor)
Visits this StateObject by the given visitor. |
CollectionMemberDeclarationStateObject |
addDerivedCollectionDeclaration()
Adds a new derived collection declaration to the FROM clause. |
CollectionMemberDeclarationStateObject |
addDerivedCollectionDeclaration(java.lang.String collectionValuedPath)
Adds a new derived collection declaration to the FROM clause. |
DerivedPathIdentificationVariableDeclarationStateObject |
addDerivedPathDeclaration()
Adds a new derived identification variable declaration to the FROM clause. |
DerivedPathIdentificationVariableDeclarationStateObject |
addDerivedPathDeclaration(java.lang.String path,
java.lang.String identificationVariable)
Adds a new derived identification variable declaration to the FROM clause. |
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. |
SimpleFromClause |
getExpression()
Returns the actual parsed object if this StateObject representation of the JPQL query
was created by parsing an existing JPQL query. |
SimpleSelectStatementStateObject |
getParent()
Returns the parent of this StateObject. |
void |
setExpression(SimpleFromClause 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. |
| Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractFromClauseStateObject |
|---|
addCollectionDeclaration, addCollectionDeclaration, addProblems, addRangeDeclaration, addRangeDeclaration, addRangeDeclaration, declarations, findIdentificationVariable, getDeclaration, getManagedType, identificationVariables, isEquivalent, listName, parse, toTextInternal |
| Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractListHolderStateObject |
|---|
addChildren, addItem, addItems, addListChangeListener, areChildrenEquivalent, canMoveDown, canMoveUp, getItem, hasItems, initialize, items, itemsSize, moveDown, moveUp, removeItem, removeItems, removeListChangeListener, toStringItems |
| Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractStateObject |
|---|
acceptUnknownVisitor, 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, toText |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.persistence.jpa.jpql.model.query.StateObject |
|---|
addPropertyChangeListener, children, decorate, getDecorator, getGrammar, getManagedTypeProvider, getQueryBuilder, getRoot, isDecorated, removePropertyChangeListener, setParent, toString, toText |
| Constructor Detail |
|---|
public SimpleFromClauseStateObject(SimpleSelectStatementStateObject parent)
SimpleFromClauseStateObject.
parent - The parent of this state object, which cannot be null
java.lang.NullPointerException - The given parent cannot be null| Method Detail |
|---|
public void accept(StateObjectVisitor visitor)
StateObject by the given visitor.
visitor - The visitor to visit this objectpublic CollectionMemberDeclarationStateObject addDerivedCollectionDeclaration()
FROM clause.
CollectionMemberDeclarationStateObject representing the collection
declarationpublic CollectionMemberDeclarationStateObject addDerivedCollectionDeclaration(java.lang.String collectionValuedPath)
FROM clause.
collectionValuedPath - The collection-valued path expression
CollectionMemberDeclarationStateObject representing the collection
declarationpublic DerivedPathIdentificationVariableDeclarationStateObject addDerivedPathDeclaration()
FROM clause.
DerivedPathIdentificationVariableDeclarationStateObject representing the
path declaration
public DerivedPathIdentificationVariableDeclarationStateObject addDerivedPathDeclaration(java.lang.String path,
java.lang.String identificationVariable)
FROM clause.
path - Either the derived singled-valued object field or the collection-valued path expressionidentificationVariable - The identification variable defining the given path
DerivedPathIdentificationVariableDeclarationStateObject representing the
path declarationpublic 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
VALUE
IManagedType representing the domain object declared by the given
identification variableDeclarationStateObject.getManagedType(StateObject)public SimpleFromClause 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 SimpleSelectStatementStateObject getParent()
StateObject.
getParent in interface StateObjectgetParent in class AbstractFromClauseStateObjectStateObject, which is null only when
this is the root of the hierarchypublic void setExpression(SimpleFromClause 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 subquery
FROM
|
EclipseLink 2.4.1, build 'v20121003-ad44345' API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||