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 voidaccept(StateObjectVisitor visitor)Visits thisStateObjectby the givenvisitor.protected AbstractRangeVariableDeclarationStateObjectbuildRangeVariableDeclarationStateObject()CreatesIManagedTypegetManagedType(StateObject stateObject)Returns theIManagedTypefor the given identification variable.SimpleFromClauseStateObjectgetParent()Returns the parent of thisStateObject.java.lang.StringgetPath()Returns the string representation of the path expression, which is either a singled-valued object field or a collection-valued path expression.DerivedPathVariableDeclarationStateObjectgetRangeVariableDeclaration()Returns theStateObjectrepresenting the range variable declaration portion.CollectionValuedPathExpressionStateObjectgetRootStateObject()Returns theStateObjectrepresenting the "root" for objects which may not be reachable by navigation.ListIterable<JoinStateObject>items()Returns anListIterableover 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 benullpath- 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 thisStateObjectby the givenvisitor.- Parameters:
visitor- Thevisitorto visit this object
-
buildRangeVariableDeclarationStateObject
protected AbstractRangeVariableDeclarationStateObject buildRangeVariableDeclarationStateObject()
Creates- Specified by:
buildRangeVariableDeclarationStateObjectin classAbstractIdentificationVariableDeclarationStateObject- Returns:
-
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 SimpleFromClauseStateObject getParent()
Returns the parent of thisStateObject.- Specified by:
getParentin interfaceStateObject- Overrides:
getParentin classAbstractIdentificationVariableDeclarationStateObject- 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, 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 theStateObjectrepresenting the range variable declaration portion.- Overrides:
getRangeVariableDeclarationin classAbstractIdentificationVariableDeclarationStateObject- Returns:
- The concrete instance
-
getRootStateObject
public CollectionValuedPathExpressionStateObject getRootStateObject()
Returns theStateObjectrepresenting the "root" for objects which may not be reachable by navigation.- Overrides:
getRootStateObjectin classAbstractIdentificationVariableDeclarationStateObject- Returns:
- The
StateObjectrepresenting one of the possible valid "root"
-
items
public ListIterable<JoinStateObject> items()
Returns anListIterableover the children.- Specified by:
itemsin interfaceListHolderStateObject<JoinStateObject>- Overrides:
itemsin classAbstractListHolderStateObject<JoinStateObject>- Returns:
- An
ListIterablethat is iterating over the children
-
-