Class DerivedPathIdentificationVariableDeclarationStateObject
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject<JoinStateObject>
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.DerivedPathIdentificationVariableDeclarationStateObject
-
- All Implemented Interfaces:
ListHolderStateObject<JoinStateObject>
,StateObject
,VariableDeclarationStateObject
public class DerivedPathIdentificationVariableDeclarationStateObject extends AbstractIdentificationVariableDeclarationStateObject
- Version:
- 2.5
- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject
JOINS_LIST
-
-
Constructor Summary
Constructors Constructor Description DerivedPathIdentificationVariableDeclarationStateObject(SimpleFromClauseStateObject parent)
Creates a newIdentificationVariableDeclarationStateObject
.DerivedPathIdentificationVariableDeclarationStateObject(SimpleFromClauseStateObject parent, java.lang.String path, java.lang.String identificationVariable)
Creates a newIdentificationVariableDeclarationStateObject
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(StateObjectVisitor visitor)
Visits thisStateObject
by the givenvisitor
.protected AbstractRangeVariableDeclarationStateObject
buildRangeVariableDeclarationStateObject()
CreatesIManagedType
getManagedType(StateObject stateObject)
Returns theIManagedType
for the given identification variable.SimpleFromClauseStateObject
getParent()
Returns the parent of thisStateObject
.java.lang.String
getPath()
Returns the string representation of the path expression, which is either a singled-valued object field or a collection-valued path expression.DerivedPathVariableDeclarationStateObject
getRangeVariableDeclaration()
Returns theStateObject
representing the range variable declaration portion.CollectionValuedPathExpressionStateObject
getRootStateObject()
Returns theStateObject
representing the "root" for objects which may not be reachable by navigation.ListIterable<JoinStateObject>
items()
Returns anListIterable
over the children.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject
addChildren, addInnerJoin, addJoin, addJoin, addJoin, addJoin, addLeftJoin, addLeftOuterJoin, getExpression, getIdentificationVariable, getIdentificationVariableStateObject, getRootPath, identificationVariables, initialize, isEquivalent, listName, parseJoin, setExpression, setIdentificationVariable, setRootPath, toTextInternal
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject
addItem, addItems, addListChangeListener, areChildrenEquivalent, canMoveDown, canMoveUp, getItem, hasItems, itemsSize, moveDown, moveUp, removeItem, removeItems, removeListChangeListener, toStringItems
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
acceptUnknownVisitor, acceptUnknownVisitor, addProblems, 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
-
DerivedPathIdentificationVariableDeclarationStateObject
public DerivedPathIdentificationVariableDeclarationStateObject(SimpleFromClauseStateObject parent)
Creates a newIdentificationVariableDeclarationStateObject
.- Parameters:
parent
- The parent of this state object, which cannot benull
- Throws:
java.lang.NullPointerException
- The given parent cannot benull
-
DerivedPathIdentificationVariableDeclarationStateObject
public DerivedPathIdentificationVariableDeclarationStateObject(SimpleFromClauseStateObject parent, java.lang.String path, java.lang.String identificationVariable)
Creates a newIdentificationVariableDeclarationStateObject
.- Parameters:
parent
- The parent of this state object, which cannot benull
path
- Either the derived singled-valued object field or the collection-valued path expressionidentificationVariable
- The identification variable defining the given path- Throws:
java.lang.NullPointerException
- The given parent cannot benull
-
-
Method Detail
-
accept
public void accept(StateObjectVisitor visitor)
Visits thisStateObject
by the givenvisitor
.- Parameters:
visitor
- Thevisitor
to visit this object
-
buildRangeVariableDeclarationStateObject
protected AbstractRangeVariableDeclarationStateObject buildRangeVariableDeclarationStateObject()
Creates- Specified by:
buildRangeVariableDeclarationStateObject
in classAbstractIdentificationVariableDeclarationStateObject
- Returns:
-
getManagedType
public IManagedType getManagedType(StateObject stateObject)
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
public SimpleFromClauseStateObject getParent()
Returns the parent of thisStateObject
.- Specified by:
getParent
in interfaceStateObject
- Overrides:
getParent
in classAbstractIdentificationVariableDeclarationStateObject
- Returns:
- Returns the parent of this
StateObject
, which isnull
only when this is the root of the hierarchy
-
getPath
public java.lang.String getPath()
Returns the string representation of the path expression, which is either a singled-valued object field or a collection-valued path expression.- Returns:
- The path expression, which is never
null
-
getRangeVariableDeclaration
public DerivedPathVariableDeclarationStateObject getRangeVariableDeclaration()
Returns theStateObject
representing the range variable declaration portion.- Overrides:
getRangeVariableDeclaration
in classAbstractIdentificationVariableDeclarationStateObject
- Returns:
- The concrete instance
-
getRootStateObject
public CollectionValuedPathExpressionStateObject getRootStateObject()
Returns theStateObject
representing the "root" for objects which may not be reachable by navigation.- Overrides:
getRootStateObject
in classAbstractIdentificationVariableDeclarationStateObject
- Returns:
- The
StateObject
representing one of the possible valid "root"
-
items
public ListIterable<JoinStateObject> items()
Returns anListIterable
over the children.- Specified by:
items
in interfaceListHolderStateObject<JoinStateObject>
- Overrides:
items
in classAbstractListHolderStateObject<JoinStateObject>
- Returns:
- An
ListIterable
that is iterating over the children
-
-