Top Description Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.model.query

public abstract Class EncapsulatedIdentificationVariableExpressionStateObject

extends AbstractSingleEncapsulatedExpressionStateObject
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.model.query.EntryExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.KeyExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.ObjectExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.ValueExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.IndexExpressionStateObject
Annotations
@SuppressWarnings:nls
Imports
org.eclipse.persistence.jpa.jpql.ExpressionTools, org.eclipse.persistence.jpa.jpql.parser.EncapsulatedIdentificationVariableExpression, .IdentificationVariableBNF, org.eclipse.persistence.jpa.jpql.tools.spi.IManagedType, .IType, .ITypeDeclaration

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

BNF: <identifier>(identification_variable)

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
EncapsulatedIdentificationVariableExpression

Field Summary

Modifier and TypeField and Description
public static final String
IDENTIFICATION_VARIABLE_PROPERTY

Notifies the identification variable property has changed.

private String
identificationVariable

The cached identification variable that is used to make sure it's the same as the one stored in the IdentificationVariableStateObject itself.

private IManagedType
managedType

The IManagedType mapped to the identification variable if the identification variable maps to an entity name.

private IType
type

The cached IType of the value to resolve.

private ITypeDeclaration
typeDeclaration

The cached ITypeDeclaration of the value to resolve.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject:
STATE_OBJECT_PROPERTY

Constructor Summary

AccessConstructor and Description
protected
EncapsulatedIdentificationVariableExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
)

Creates a new EncapsulatedIdentificationVariableExpressionStateObject.

protected
EncapsulatedIdentificationVariableExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The identification variable
identificationVariable
)

Creates a new EncapsulatedIdentificationVariableExpressionStateObject.

Method Summary

Modifier and TypeMethod and Description
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.

public EncapsulatedIdentificationVariableExpression
getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

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

Returns:

The name of the identification variable
getIdentificationVariable
()

Returns the identification variable.

public IManagedType

Returns:

Either the IManagedType, if it could be resolved; null otherwise
getManagedType
()

Returns the IManagedType associated with the field handled by this object.

protected String
getQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getQueryBNFId.

Returns the unique identifier of the JPQLQueryBNF that will determine how to parse the encapsulated expression.
public IdentificationVariableStateObject
public IType

Returns:

Either the IType of the identification variable or the IType for IType#UNRESOLVABLE_TYPE if it could not be resolved
getType
()

Returns the IType of the field handled by this object.

public ITypeDeclaration

Returns:

Either the ITypeDeclaration that was resolved by this object or the ITypeDeclaration for IType#UNRESOLVABLE_TYPE if it could not be resolved
getTypeDeclaration
()

Returns the ITypeDeclaration of the field handled by this object.

public boolean

Returns:

true if the identification variable has been defined; false otherwise
hasIdentificationVariable
()

Determines whether the identification variable has been defined or not.

protected void
protected IManagedType

Returns:

Either the IManagedType declared by the identification variable or null if it could not be resolved
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

Returns:

Either the IType that was resolved by this object or the IType for IType#UNRESOLVABLE_TYPE if it could not be resolved
resolveType
()

Resolves the IType of the property handled by this object.

protected ITypeDeclaration

Returns:

Either the ITypeDeclaration that was resolved by this object or the ITypeDeclaration for IType#UNRESOLVABLE_TYPE if it could not be resolved
resolveTypeDeclaration
()

Resolves the ITypeDeclaration of the property handled by this object.

public void
setIdentificationVariable(String
The name of the identification variable
identificationVariable
)

Sets the identification variable of this encapsulated expression.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject:
addChildrenhasStateObjectisEquivalentparsesetStateObjecttoTextEncapsulatedExpression

Field Detail

IDENTIFICATION_VARIABLE_PROPERTYback to summary
public static final String IDENTIFICATION_VARIABLE_PROPERTY

Notifies the identification variable property has changed.

identificationVariableback to summary
private String identificationVariable

The cached identification variable that is used to make sure it's the same as the one stored in the IdentificationVariableStateObject itself.

managedTypeback to summary
private IManagedType managedType

The IManagedType mapped to the identification variable if the identification variable maps to an entity name.

typeback to summary
private IType type

The cached IType of the value to resolve.

typeDeclarationback to summary
private ITypeDeclaration typeDeclaration

The cached ITypeDeclaration of the value to resolve.

Constructor Detail

EncapsulatedIdentificationVariableExpressionStateObjectback to summary
protected EncapsulatedIdentificationVariableExpressionStateObject(StateObject parent)

Creates a new EncapsulatedIdentificationVariableExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
EncapsulatedIdentificationVariableExpressionStateObjectback to summary
protected EncapsulatedIdentificationVariableExpressionStateObject(StateObject parent, String identificationVariable)

Creates a new EncapsulatedIdentificationVariableExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

identificationVariable:String

The identification variable

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

checkIntegrityback to summary
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.

clearResolvedObjectsback to summary
protected void clearResolvedObjects()

Clears the values related to the managed type and type.

getExpressionback to summary
public EncapsulatedIdentificationVariableExpression getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.

Returns:EncapsulatedIdentificationVariableExpression

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)

Annotations
@Override
getIdentificationVariableback to summary
public String getIdentificationVariable()

Returns the identification variable.

Returns:String

The name of the identification variable

getManagedTypeback to summary
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:IManagedType

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

getQueryBNFIdback to summary
protected String getQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getQueryBNFId.

Returns the unique identifier of the JPQLQueryBNF that will determine how to parse the encapsulated expression.

Returns:String

The non-null ID of the BNF

Annotations
@Override
getStateObjectback to summary
public IdentificationVariableStateObject getStateObject()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getStateObject.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getStateObject.

Returns the encapsulated StateObject.

Returns:IdentificationVariableStateObject

The encapsulated StateObject

Annotations
@Override
getTypeback to summary
public IType getType()

Returns the IType of the field handled by this object.

Returns:IType

Either the IType of the identification variable or the IType for IType#UNRESOLVABLE_TYPE if it could not be resolved

getTypeDeclarationback to summary
public ITypeDeclaration getTypeDeclaration()

Returns the ITypeDeclaration of the field handled by this object.

Returns:ITypeDeclaration

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

hasIdentificationVariableback to summary
public boolean hasIdentificationVariable()

Determines whether the identification variable has been defined or not.

Returns:boolean

true if the identification variable has been defined; false otherwise

initializeback to summary
protected void initialize()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.initialize.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.initialize.

Initializes this state object.

Annotations
@Override
resolveManagedTypeback to summary
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:IManagedType

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

resolveTypeback to summary
protected IType resolveType()

Resolves the IType of the property handled by this object.

Returns:IType

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

resolveTypeDeclarationback to summary
protected ITypeDeclaration resolveTypeDeclaration()

Resolves the ITypeDeclaration of the property handled by this object.

Returns:ITypeDeclaration

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

setIdentificationVariableback to summary
public void setIdentificationVariable(String identificationVariable)

Sets the identification variable of this encapsulated expression.

Parameters
identificationVariable:String

The name of the identification variable