Class DerivedPathVariableDeclarationStateObject
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.DerivedPathVariableDeclarationStateObject
-
- All Implemented Interfaces:
StateObject,VariableDeclarationStateObject
public class DerivedPathVariableDeclarationStateObject extends AbstractRangeVariableDeclarationStateObject
BNF:subselect_identification_variable_declaration ::= derived_path_expression [AS] identification_variable {join}*BNF:derived_path_expression ::= superquery_identification_variable.{single_valued_object_field.}*collection_valued_field | superquery_identification_variable.{single_valued_object_field.}*single_valued_object_field- Version:
- 2.4
- See Also:
RangeVariableDeclaration- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject
AS_PROPERTY, IDENTIFICATION_VARIABLE_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description DerivedPathVariableDeclarationStateObject(DerivedPathIdentificationVariableDeclarationStateObject parent)Creates a newDerivedPathVariableDeclarationStateObject.DerivedPathVariableDeclarationStateObject(DerivedPathIdentificationVariableDeclarationStateObject parent, java.lang.String path)Creates a newDerivedPathVariableDeclarationStateObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(StateObjectVisitor visitor)Visits thisStateObjectby the givenvisitor.protected StateObjectbuildRootStateObject()IManagedTypegetManagedType(StateObject stateObject)Returns theIManagedTypefor the given identification variable.DerivedPathIdentificationVariableDeclarationStateObjectgetParent()Returns the parent of thisStateObject.java.lang.StringgetPath()Returns the string representation of the path expression.java.lang.StringgetRootPath()Returns the "root" object for objects which may not be reachable by navigation.CollectionValuedPathExpressionStateObjectgetRootStateObject()Returns theStateObjectholding onto the abstract schema name.voidsetRootPath(java.lang.String path)Sets the "root" object for objects which may not be reachable by navigation.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject
addAs, addChildren, addProblems, getExpression, getIdentificationVariable, getIdentificationVariableStateObject, hasAs, hasIdentificationVariable, identificationVariables, initialize, isEquivalent, isIdentificationVariableOptional, isIdentificationVariableVirtual, setAs, setExpression, setIdentificationVariable, setIdentificationVariableOptional, toggleAs, toTextInternal
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
acceptUnknownVisitor, acceptUnknownVisitor, addPropertyChangeListener, areEquivalent, buildProblem, buildProblem, buildStateObject, buildStateObjects, checkParent, children, decorate, equals, findIdentificationVariable, firePropertyChanged, getChangeSupport, getDeclaration, 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.tools.model.query.StateObject
addPropertyChangeListener, children, decorate, findIdentificationVariable, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getQueryBuilder, getRoot, isDecorated, removePropertyChangeListener, setParent, toString, toText
-
-
-
-
Constructor Detail
-
DerivedPathVariableDeclarationStateObject
public DerivedPathVariableDeclarationStateObject(DerivedPathIdentificationVariableDeclarationStateObject parent)
Creates a newDerivedPathVariableDeclarationStateObject.- Parameters:
parent- The parent of this state object, which cannot benull- Throws:
java.lang.NullPointerException- The given parent cannot benull
-
DerivedPathVariableDeclarationStateObject
public DerivedPathVariableDeclarationStateObject(DerivedPathIdentificationVariableDeclarationStateObject parent, java.lang.String path)
Creates a newDerivedPathVariableDeclarationStateObject.- Parameters:
parent- The parent of this state object, which cannot benullpath- Either the derived singled-valued object path expression or the collection-valued path expression- Throws:
java.lang.NullPointerException- The given parent cannot benull
-
-
Method Detail
-
accept
public void accept(StateObjectVisitor visitor)
Visits thisStateObjectby the givenvisitor.- Parameters:
visitor- Thevisitorto visit this object
-
buildRootStateObject
protected StateObject buildRootStateObject()
- Specified by:
buildRootStateObjectin classAbstractRangeVariableDeclarationStateObject
-
getManagedType
public IManagedType getManagedType(StateObject stateObject)
Returns theIManagedTypefor the given identification variable. The search does not traverse up the query hierarchy if this declaration is for a subquery.
In the above query, the managed type associated with the identification variable:SELECT e FROM Department d JOIN KEY(d.employees).addresses a- d is "Department"
- a is "Address"
- Parameters:
stateObject- TheStateObjectthat should be an simple identification variable or an encapsulated identification variable with the identifierKEYorVALUE- Returns:
- The
IManagedTyperepresenting the domain object declared by the given identification variable
-
getParent
public DerivedPathIdentificationVariableDeclarationStateObject getParent()
Returns the parent of thisStateObject.- Specified by:
getParentin interfaceStateObject- Overrides:
getParentin classAbstractStateObject- Returns:
- Returns the parent of this
StateObject, which isnullonly when this is the root of the hierarchy
-
getPath
public java.lang.String getPath()
Returns the string representation of the path expression. If the identification variable is virtual, then it is not part of the result.- Returns:
- The path expression, which is never
null
-
getRootPath
public java.lang.String getRootPath()
Returns the "root" object for objects which may not be reachable by navigation.- Specified by:
getRootPathin classAbstractRangeVariableDeclarationStateObject- Returns:
- The "root" object
-
getRootStateObject
public CollectionValuedPathExpressionStateObject getRootStateObject()
Returns theStateObjectholding onto the abstract schema name.- Overrides:
getRootStateObjectin classAbstractRangeVariableDeclarationStateObject- Returns:
- The
StateObject, which is nevernull
-
setRootPath
public void setRootPath(java.lang.String path)
Sets the "root" object for objects which may not be reachable by navigation.- Specified by:
setRootPathin classAbstractRangeVariableDeclarationStateObject- Parameters:
path- The "root" object
-
-