EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql.model.query
Class DerivedPathVariableDeclarationStateObject

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.model.query.AbstractStateObject
      extended by org.eclipse.persistence.jpa.jpql.model.query.AbstractRangeVariableDeclarationStateObject
          extended by org.eclipse.persistence.jpa.jpql.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

Version:
2.4
See Also:
RangeVariableDeclaration
Author:
Pascal Filion
Since:
2.4

Field Summary
 
Fields inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractRangeVariableDeclarationStateObject
AS_PROPERTY, IDENTIFICATION_VARIABLE_PROPERTY
 
Constructor Summary
DerivedPathVariableDeclarationStateObject(DerivedPathIdentificationVariableDeclarationStateObject parent)
          Creates a new DerivedPathVariableDeclarationStateObject.
DerivedPathVariableDeclarationStateObject(DerivedPathIdentificationVariableDeclarationStateObject parent, java.lang.String path)
          Creates a new DerivedPathVariableDeclarationStateObject.
 
Method Summary
 void accept(StateObjectVisitor visitor)
          Visits this StateObject by the given visitor.
protected  StateObject buildRootStateObject()
          
 IManagedType getManagedType(StateObject stateObject)
          Returns the IManagedType for the given identification variable.
 DerivedPathIdentificationVariableDeclarationStateObject getParent()
          Returns the parent of this StateObject.
 java.lang.String getPath()
          Returns the string representation of the path expression.
 java.lang.String getRootPath()
          Returns the "root" object for objects which may not be reachable by navigation.
 CollectionValuedPathExpressionStateObject getRootStateObject()
          Returns the StateObject holding onto the abstract schema name.
 void setRootPath(java.lang.String path)
          Sets the "root" object for objects which may not be reachable by navigation.
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractRangeVariableDeclarationStateObject
addAs, addChildren, addProblems, getExpression, getIdentificationVariable, getIdentificationVariableStateObject, hasAs, hasIdentificationVariable, identificationVariables, initialize, isEquivalent, isIdentificationVariableOptional, isIdentificationVariableVirtual, setAs, setExpression, setIdentificationVariable, setIdentificationVariableOptional, toggleAs, toTextInternal
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractStateObject
acceptUnknownVisitor, acceptUnknownVisitor, 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.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 new DerivedPathVariableDeclarationStateObject.

Parameters:
parent - The parent of this state object, which cannot be null
Throws:
java.lang.NullPointerException - The given parent cannot be null

DerivedPathVariableDeclarationStateObject

public DerivedPathVariableDeclarationStateObject(DerivedPathIdentificationVariableDeclarationStateObject parent,
                                                 java.lang.String path)
Creates a new DerivedPathVariableDeclarationStateObject.

Parameters:
parent - The parent of this state object, which cannot be null
path - Either the derived singled-valued object path expression or the collection-valued path expression
Throws:
java.lang.NullPointerException - The given parent cannot be null
Method Detail

accept

public void accept(StateObjectVisitor visitor)
Visits this StateObject by the given visitor.

Parameters:
visitor - The visitor to visit this object

buildRootStateObject

protected StateObject buildRootStateObject()

Specified by:
buildRootStateObject in class AbstractRangeVariableDeclarationStateObject

getManagedType

public IManagedType getManagedType(StateObject stateObject)
Returns the IManagedType for the given identification variable. The search does not traverse up the query hierarchy if this declaration is for a subquery.

SELECT e FROM Department d JOIN KEY(d.employees).addresses a
In the above query, the managed type associated with the identification variable:
  • d is "Department"
  • a is "Address"

Parameters:
stateObject - The StateObject that should be an simple identification variable or an encapsulated identification variable with the identifier KEY or VALUE
Returns:
The IManagedType representing the domain object declared by the given identification variable

getParent

public DerivedPathIdentificationVariableDeclarationStateObject getParent()
Returns the parent of this StateObject.

Specified by:
getParent in interface StateObject
Overrides:
getParent in class AbstractStateObject
Returns:
Returns the parent of this StateObject, which is null only when this is the root of the hierarchy

getPath

public java.lang.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 java.lang.String getRootPath()
Returns the "root" object for objects which may not be reachable by navigation.

Specified by:
getRootPath in class AbstractRangeVariableDeclarationStateObject
Returns:
The "root" object

getRootStateObject

public CollectionValuedPathExpressionStateObject getRootStateObject()
Returns the StateObject holding onto the abstract schema name.

Overrides:
getRootStateObject in class AbstractRangeVariableDeclarationStateObject
Returns:
The StateObject, which is never null

setRootPath

public void setRootPath(java.lang.String path)
Sets the "root" object for objects which may not be reachable by navigation.

Specified by:
setRootPath in class AbstractRangeVariableDeclarationStateObject
Parameters:
path - The "root" object

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference