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
- Since:
- 2.4
- Version:
- 2.5
- Author:
- Pascal Filion
-
-
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, String path, 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.IManagedTypegetManagedType(StateObject stateObject)Returns theIManagedTypefor the given identification variable.SimpleFromClauseStateObjectgetParent()Returns the parent of thisStateObject.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
addInnerJoin, addJoin, addJoin, addJoin, addJoin, addLeftJoin, addLeftOuterJoin, getExpression, getIdentificationVariable, getIdentificationVariableStateObject, getRootPath, identificationVariables, isEquivalent, parseJoin, setExpression, setIdentificationVariable, setRootPath
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject
addItem, addItems, addListChangeListener, canMoveDown, canMoveUp, getItem, hasItems, itemsSize, moveDown, moveUp, removeItem, removeItems, removeListChangeListener
-
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
-
DerivedPathIdentificationVariableDeclarationStateObject
public DerivedPathIdentificationVariableDeclarationStateObject(SimpleFromClauseStateObject parent)
Creates a newIdentificationVariableDeclarationStateObject.- Parameters:
parent- The parent of this state object, which cannot benull- Throws:
NullPointerException- The given parent cannot benull
-
DerivedPathIdentificationVariableDeclarationStateObject
public DerivedPathIdentificationVariableDeclarationStateObject(SimpleFromClauseStateObject parent, String path, 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:
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 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 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
-
-