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
- Author:
- Pascal Filion
- See Also:
RangeVariableDeclaration
-
-
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, 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.IManagedTypegetManagedType(StateObject stateObject)Returns theIManagedTypefor the given identification variable.DerivedPathIdentificationVariableDeclarationStateObjectgetParent()Returns the parent of thisStateObject.StringgetPath()Returns the string representation of the path expression.StringgetRootPath()Returns the "root" object for objects which may not be reachable by navigation.CollectionValuedPathExpressionStateObjectgetRootStateObject()Returns theStateObjectholding onto the abstract schema name.voidsetRootPath(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, getExpression, getIdentificationVariable, getIdentificationVariableStateObject, hasAs, hasIdentificationVariable, identificationVariables, isEquivalent, isIdentificationVariableOptional, isIdentificationVariableVirtual, setAs, setExpression, setIdentificationVariable, toggleAs
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
addPropertyChangeListener, children, decorate, equals, findIdentificationVariable, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, isDecorated, removePropertyChangeListener, setExpression, setParent, toString, toString, toText
-
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:
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 benullpath- Either the derived singled-valued object path expression or the collection-valued path expression- Throws:
NullPointerException- The given parent cannot benull
-
-
Method Detail
-
accept
public void accept(StateObjectVisitor visitor)
Visits thisStateObjectby the givenvisitor.- Parameters:
visitor- Thevisitorto visit this object
-
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 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 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(String path)
Sets the "root" object for objects which may not be reachable by navigation.- Specified by:
setRootPathin classAbstractRangeVariableDeclarationStateObject- Parameters:
path- The "root" object
-
-