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
- Since:
- 2.4
- Version:
- 2.4
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject
AS_PROPERTY, IDENTIFICATION_VARIABLE_PROPERTY
-
Constructor Summary
ConstructorDescriptionDerivedPathVariableDeclarationStateObject
(DerivedPathIdentificationVariableDeclarationStateObject parent) Creates a newDerivedPathVariableDeclarationStateObject
.DerivedPathVariableDeclarationStateObject
(DerivedPathIdentificationVariableDeclarationStateObject parent, String path) Creates a newDerivedPathVariableDeclarationStateObject
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(StateObjectVisitor visitor) Visits thisStateObject
by the givenvisitor
.protected StateObject
getManagedType
(StateObject stateObject) Returns theIManagedType
for the given identification variable.Returns the parent of thisStateObject
.getPath()
Returns the string representation of the path expression.Returns the "root" object for objects which may not be reachable by navigation.Returns theStateObject
holding onto the abstract schema name.void
setRootPath
(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 Details
-
DerivedPathVariableDeclarationStateObject
public DerivedPathVariableDeclarationStateObject(DerivedPathIdentificationVariableDeclarationStateObject parent) Creates a newDerivedPathVariableDeclarationStateObject
.- Parameters:
parent
- The parent of this state object, which cannot benull
- Throws:
NullPointerException
- The given parent cannot benull
-
DerivedPathVariableDeclarationStateObject
public DerivedPathVariableDeclarationStateObject(DerivedPathIdentificationVariableDeclarationStateObject parent, String path) Creates a newDerivedPathVariableDeclarationStateObject
.- Parameters:
parent
- The parent of this state object, which cannot benull
path
- Either the derived singled-valued object path expression or the collection-valued path expression- Throws:
NullPointerException
- The given parent cannot benull
-
-
Method Details
-
accept
Description copied from interface:StateObject
Visits thisStateObject
by the givenvisitor
.- Parameters:
visitor
- Thevisitor
to visit this object
-
buildRootStateObject
- Specified by:
buildRootStateObject
in classAbstractRangeVariableDeclarationStateObject
-
getManagedType
Description copied from interface:VariableDeclarationStateObject
Returns theIManagedType
for 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
- TheStateObject
that should be an simple identification variable or an encapsulated identification variable with the identifierKEY
orVALUE
- Returns:
- The
IManagedType
representing the domain object declared by the given identification variable
-
getParent
Description copied from interface:StateObject
Returns the parent of thisStateObject
.- Specified by:
getParent
in interfaceStateObject
- Overrides:
getParent
in classAbstractStateObject
- Returns:
- Returns the parent of this
StateObject
, which isnull
only when this is the root of the hierarchy
-
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
Description copied from class:AbstractRangeVariableDeclarationStateObject
Returns the "root" object for objects which may not be reachable by navigation.- Specified by:
getRootPath
in classAbstractRangeVariableDeclarationStateObject
- Returns:
- The "root" object
-
getRootStateObject
Description copied from class:AbstractRangeVariableDeclarationStateObject
Returns theStateObject
holding onto the abstract schema name.- Overrides:
getRootStateObject
in classAbstractRangeVariableDeclarationStateObject
- Returns:
- The
StateObject
, which is nevernull
-
setRootPath
Description copied from class:AbstractRangeVariableDeclarationStateObject
Sets the "root" object for objects which may not be reachable by navigation.- Specified by:
setRootPath
in classAbstractRangeVariableDeclarationStateObject
- Parameters:
path
- The "root" object
-