Class RangeVariableDeclarationStateObject
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.RangeVariableDeclarationStateObject
- All Implemented Interfaces:
StateObject,VariableDeclarationStateObject
public class RangeVariableDeclarationStateObject
extends AbstractRangeVariableDeclarationStateObject
Range variable declarations allow the developer to designate a "root" for objects which may not
be reachable by navigation. In order to select values by comparing more than one instance of an
entity abstract schema type, more than one identification variable ranging over the abstract
schema type is needed in the
FROM clause.
BNF: range_variable_declaration ::= abstract_schema_name [AS] identification_variable
- 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
ConstructorsConstructorDescriptionCreates a newRangeVariableDeclarationStateObject.Creates a newRangeVariableDeclarationStateObject.RangeVariableDeclarationStateObject(IdentificationVariableDeclarationStateObject parent, String entityName) Creates a newRangeVariableDeclarationStateObject. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(StateObjectVisitor visitor) Visits thisStateObjectby the givenvisitor.addAs()Makes sure theASidentifier is specified.protected StateObjectReturns the actualIEntitythat has the abstract schema name.Returns the abstract schema name.getManagedType(StateObject stateObject) Returns theIManagedTypefor the given identification variable.Returns the "root" object for objects which may not be reachable by navigation.Returns theStateObjectholding onto the abstract schema name.voidsetDeclaration(String entityName, String identificationVariable) Sets the abstract schema name to the given value and the identification variable that will range over it.voidsetDeclaration(IEntity entity) Sets the abstract schema name to the given value.voidsetDeclaration(IEntity entity, String identificationVariable) Sets the abstract schema name to the given value and the identification variable that will range over it.voidSets the actualIEntityand updates the abstract schema name.voidsetEntityName(String abstractSchemaName) Sets the name of the abstract schema, which is the name of the entity.voidsetRootPath(String root) 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
addChildren, addProblems, getExpression, getIdentificationVariable, getIdentificationVariableStateObject, hasAs, hasIdentificationVariable, identificationVariables, initialize, isEquivalent, isIdentificationVariableOptional, isIdentificationVariableVirtual, setAs, setExpression, setIdentificationVariable, setIdentificationVariableOptional, toggleAs, toTextInternalMethods 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, getParent, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, isDecorated, parent, parent, parent, removePropertyChangeListener, setExpression, setParent, toString, toString, toStringInternal, toStringItems, toTextMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
addPropertyChangeListener, children, decorate, findIdentificationVariable, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, isDecorated, removePropertyChangeListener, setParent, toString, toText
-
Constructor Details
-
RangeVariableDeclarationStateObject
Creates a newRangeVariableDeclarationStateObject.- Parameters:
parent- The parent of this state object, which cannot benull- Throws:
NullPointerException- The given parent cannot benull
-
RangeVariableDeclarationStateObject
Creates a newRangeVariableDeclarationStateObject.- Parameters:
parent- The parent of this state object, which cannot benull- Throws:
NullPointerException- The given parent cannot benull
-
RangeVariableDeclarationStateObject
public RangeVariableDeclarationStateObject(IdentificationVariableDeclarationStateObject parent, String entityName) Creates a newRangeVariableDeclarationStateObject.- Parameters:
parent- The parent of this state object, which cannot benullentityName- The name of the abstract schema, which is the name of the entity- Throws:
NullPointerException- The given parent cannot benull
-
-
Method Details
-
accept
Description copied from interface:StateObjectVisits thisStateObjectby the givenvisitor.- Parameters:
visitor- Thevisitorto visit this object
-
addAs
Description copied from class:AbstractRangeVariableDeclarationStateObjectMakes sure theASidentifier is specified.- Overrides:
addAsin classAbstractRangeVariableDeclarationStateObject- Returns:
- This object
-
buildRootStateObject
- Specified by:
buildRootStateObjectin classAbstractRangeVariableDeclarationStateObject
-
getEntity
Returns the actualIEntitythat has the abstract schema name.- Returns:
- The actual
IEntityornullif no entity exists
-
getEntityName
Returns the abstract schema name.- Returns:
- The name of the abstract schema type for which the identification variable is ranging over
-
getManagedType
Description copied from interface:VariableDeclarationStateObjectReturns 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
-
getRootPath
Description copied from class:AbstractRangeVariableDeclarationStateObjectReturns the "root" object for objects which may not be reachable by navigation.- Specified by:
getRootPathin classAbstractRangeVariableDeclarationStateObject- Returns:
- The "root" object
-
getRootStateObject
Description copied from class:AbstractRangeVariableDeclarationStateObjectReturns theStateObjectholding onto the abstract schema name.- Overrides:
getRootStateObjectin classAbstractRangeVariableDeclarationStateObject- Returns:
- The
StateObject, which is nevernull
-
setDeclaration
Sets the abstract schema name to the given value.- Parameters:
entity- TheIEntitythat this clause will range over
-
setDeclaration
Sets the abstract schema name to the given value and the identification variable that will range over it.- Parameters:
entity- TheIEntitythat this clause will range overidentificationVariable- The new identification variable
-
setDeclaration
Sets the abstract schema name to the given value and the identification variable that will range over it.- Parameters:
entityName- The name of the entity nameidentificationVariable- The new identification variable
-
setEntity
Sets the actualIEntityand updates the abstract schema name.- Parameters:
entity- TheIEntitythat the clause will range over
-
setEntityName
Sets the name of the abstract schema, which is the name of the entity.- Parameters:
abstractSchemaName- The name of the abstract schema, which is the name of the entity
-
setRootPath
Description copied from class:AbstractRangeVariableDeclarationStateObjectSets the "root" object for objects which may not be reachable by navigation.- Specified by:
setRootPathin classAbstractRangeVariableDeclarationStateObject- Parameters:
root- The "root" object
-