EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

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

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.model.query.AbstractStateObject
      extended by org.eclipse.persistence.jpa.jpql.model.query.AbstractEncapsulatedExpressionStateObject
          extended by org.eclipse.persistence.jpa.jpql.model.query.AbstractSingleEncapsulatedExpressionStateObject
              extended by org.eclipse.persistence.jpa.jpql.model.query.EncapsulatedIdentificationVariableExpressionStateObject
All Implemented Interfaces:
StateObject
Direct Known Subclasses:
EntryExpressionStateObject, IndexExpressionStateObject, KeyExpressionStateObject, ObjectExpressionStateObject, ValueExpressionStateObject

public abstract class EncapsulatedIdentificationVariableExpressionStateObject
extends AbstractSingleEncapsulatedExpressionStateObject

This object represents an identification variable that is wrapped by a function.

BNF: <identifier>(identification_variable)

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

Field Summary
static java.lang.String IDENTIFICATION_VARIABLE_PROPERTY
          Notifies the identification variable property has changed.
 
Fields inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractSingleEncapsulatedExpressionStateObject
STATE_OBJECT_PROPERTY
 
Constructor Summary
protected EncapsulatedIdentificationVariableExpressionStateObject(StateObject parent)
          Creates a new EncapsulatedIdentificationVariableExpressionStateObject.
protected EncapsulatedIdentificationVariableExpressionStateObject(StateObject parent, java.lang.String identificationVariable)
          Creates a new EncapsulatedIdentificationVariableExpressionStateObject.
 
Method Summary
protected  void checkIntegrity()
          Makes sure the cached identification variable and the one owned by IdentificationVariableStateObject are the same.
protected  void clearResolvedObjects()
          Clears the values related to the managed type and type.
 EncapsulatedIdentificationVariableExpression getExpression()
          Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
 java.lang.String getIdentificationVariable()
          Returns the identification variable.
 IManagedType getManagedType()
          Returns the IManagedType associated with the field handled by this object.
protected  java.lang.String getQueryBNFId()
          Returns the unique identifier of the JPQLQueryBNF that will determine how to parse the encapsulated expression.
 IdentificationVariableStateObject getStateObject()
          Returns the encapsulated StateObject.
 IType getType()
          Returns the IType of the field handled by this object.
 ITypeDeclaration getTypeDeclaration()
          Returns the ITypeDeclaration of the field handled by this object.
 boolean hasIdentificationVariable()
          Determines whether the identification variable has been defined or not.
protected  void initialize()
          Initializes this state object.
protected  IManagedType resolveManagedType()
          Retrieves the IManagedType that is mapped to the identification variable, if and only if the identification variable is used to declare an entity.
protected  IType resolveType()
          Resolves the IType of the property handled by this object.
protected  ITypeDeclaration resolveTypeDeclaration()
          Resolves the ITypeDeclaration of the property handled by this object.
 void setIdentificationVariable(java.lang.String identificationVariable)
          Sets the identification variable of this encapsulated expression.
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractSingleEncapsulatedExpressionStateObject
addChildren, hasStateObject, isEquivalent, parse, setStateObject, toTextEncapsulatedExpression
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractEncapsulatedExpressionStateObject
getIdentifier, toTextInternal
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractStateObject
acceptUnknownVisitor, acceptUnknownVisitor, addProblems, 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, 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
accept
 

Field Detail

IDENTIFICATION_VARIABLE_PROPERTY

public static final java.lang.String IDENTIFICATION_VARIABLE_PROPERTY
Notifies the identification variable property has changed.

See Also:
Constant Field Values
Constructor Detail

EncapsulatedIdentificationVariableExpressionStateObject

protected EncapsulatedIdentificationVariableExpressionStateObject(StateObject parent)
Creates a new EncapsulatedIdentificationVariableExpressionStateObject.

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

EncapsulatedIdentificationVariableExpressionStateObject

protected EncapsulatedIdentificationVariableExpressionStateObject(StateObject parent,
                                                                  java.lang.String identificationVariable)
Creates a new EncapsulatedIdentificationVariableExpressionStateObject.

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

checkIntegrity

protected void checkIntegrity()
Makes sure the cached identification variable and the one owned by IdentificationVariableStateObject are the same. If they are not, then clears the cached values related to the type.


clearResolvedObjects

protected void clearResolvedObjects()
Clears the values related to the managed type and type.


getExpression

public EncapsulatedIdentificationVariableExpression getExpression()
Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.

Specified by:
getExpression in interface StateObject
Overrides:
getExpression in class AbstractSingleEncapsulatedExpressionStateObject
Returns:
The parsed object when a JPQL query is parsed and converted into a StateObject or null when the JPQL query is manually created (i.e. not from a string)

getIdentificationVariable

public java.lang.String getIdentificationVariable()
Returns the identification variable.

Returns:
The name of the identification variable

getManagedType

public IManagedType getManagedType()
Returns the IManagedType associated with the field handled by this object. If this object does not handle a field that has a IManagedType, then null should be returned.

For example: "SELECT e FROM Employee e", the object for e would be returning the IManagedType for Employee.

Returns:
Either the IManagedType, if it could be resolved; null otherwise

getQueryBNFId

protected java.lang.String getQueryBNFId()
Returns the unique identifier of the JPQLQueryBNF that will determine how to parse the encapsulated expression.

Specified by:
getQueryBNFId in class AbstractSingleEncapsulatedExpressionStateObject
Returns:
The non-null ID of the BNF

getStateObject

public IdentificationVariableStateObject getStateObject()
Returns the encapsulated StateObject.

Overrides:
getStateObject in class AbstractSingleEncapsulatedExpressionStateObject
Returns:
The encapsulated StateObject

getType

public IType getType()
Returns the IType of the field handled by this object.

Returns:
Either the IType of the identification variable or the IType for IType.UNRESOLVABLE_TYPE if it could not be resolved

getTypeDeclaration

public ITypeDeclaration getTypeDeclaration()
Returns the ITypeDeclaration of the field handled by this object.

Returns:
Either the ITypeDeclaration that was resolved by this object or the ITypeDeclaration for IType.UNRESOLVABLE_TYPE if it could not be resolved

hasIdentificationVariable

public boolean hasIdentificationVariable()
Determines whether the identification variable has been defined or not.

Returns:
true if the identification variable has been defined; false otherwise

initialize

protected void initialize()
Initializes this state object.

Overrides:
initialize in class AbstractStateObject

resolveManagedType

protected IManagedType resolveManagedType()
Retrieves the IManagedType that is mapped to the identification variable, if and only if the identification variable is used to declare an entity.

Returns:
Either the IManagedType declared by the identification variable or null if it could not be resolved

resolveType

protected IType resolveType()
Resolves the IType of the property handled by this object.

Returns:
Either the IType that was resolved by this object or the IType for IType.UNRESOLVABLE_TYPE if it could not be resolved

resolveTypeDeclaration

protected ITypeDeclaration resolveTypeDeclaration()
Resolves the ITypeDeclaration of the property handled by this object.

Returns:
Either the ITypeDeclaration that was resolved by this object or the ITypeDeclaration for IType.UNRESOLVABLE_TYPE if it could not be resolved

setIdentificationVariable

public void setIdentificationVariable(java.lang.String identificationVariable)
Sets the identification variable of this encapsulated expression.

Parameters:
identificationVariable - The name of the identification variable

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference