Class EncapsulatedIdentificationVariableExpressionStateObject
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject
org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject
org.eclipse.persistence.jpa.jpql.tools.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)
- Since:
- 2.4
- Version:
- 2.4
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringNotifies the identification variable property has changed.Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject
STATE_OBJECT_PROPERTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a newEncapsulatedIdentificationVariableExpressionStateObject.protectedEncapsulatedIdentificationVariableExpressionStateObject(StateObject parent, String identificationVariable) Creates a newEncapsulatedIdentificationVariableExpressionStateObject. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidMakes sure the cached identification variable and the one owned byIdentificationVariableStateObjectare the same.protected voidClears the values related to the managed type and type.Returns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.Returns the identification variable.Returns theIManagedTypeassociated with the field handled by this object.protected StringReturns the unique identifier of theJPQLQueryBNFthat will determine how to parse the encapsulated expression.Returns the encapsulatedStateObject.getType()Returns theITypeof the field handled by this object.Returns theITypeDeclarationof the field handled by this object.booleanDetermines whether the identification variable has been defined or not.protected voidInitializes this state object.protected IManagedTypeRetrieves theIManagedTypethat is mapped to the identification variable, if and only if the identification variable is used to declare an entity.protected ITypeResolves theITypeof the property handled by this object.protected ITypeDeclarationResolves theITypeDeclarationof the property handled by this object.voidsetIdentificationVariable(String identificationVariable) Sets the identification variable of this encapsulated expression.Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject
addChildren, hasStateObject, isEquivalent, parse, setStateObject, toTextEncapsulatedExpressionMethods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject
getIdentifier, toTextInternalMethods inherited from class org.eclipse.persistence.jpa.jpql.tools.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, 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
accept
-
Field Details
-
IDENTIFICATION_VARIABLE_PROPERTY
Notifies the identification variable property has changed.- See Also:
-
-
Constructor Details
-
EncapsulatedIdentificationVariableExpressionStateObject
Creates a newEncapsulatedIdentificationVariableExpressionStateObject.- Parameters:
parent- The parent of this state object, which cannot benull- Throws:
NullPointerException- The given parent cannot benull
-
EncapsulatedIdentificationVariableExpressionStateObject
protected EncapsulatedIdentificationVariableExpressionStateObject(StateObject parent, String identificationVariable) Creates a newEncapsulatedIdentificationVariableExpressionStateObject.- Parameters:
parent- The parent of this state object, which cannot benullidentificationVariable- The identification variable- Throws:
NullPointerException- The given parent cannot benull
-
-
Method Details
-
checkIntegrity
protected void checkIntegrity()Makes sure the cached identification variable and the one owned byIdentificationVariableStateObjectare 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
Description copied from interface:StateObjectReturns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.- Specified by:
getExpressionin interfaceStateObject- Overrides:
getExpressionin classAbstractSingleEncapsulatedExpressionStateObject- Returns:
- The parsed object when a JPQL query is parsed and converted into a
StateObjectornullwhen the JPQL query is manually created (i.e. not from a string)
-
getIdentificationVariable
Returns the identification variable.- Returns:
- The name of the identification variable
-
getManagedType
Returns theIManagedTypeassociated with the field handled by this object. If this object does not handle a field that has aIManagedType, thennullshould be returned.For example: "
SELECT e FROM Employee e", the object for e would be returning theIManagedTypefor Employee.- Returns:
- Either the
IManagedType, if it could be resolved;nullotherwise
-
getQueryBNFId
Description copied from class:AbstractSingleEncapsulatedExpressionStateObjectReturns the unique identifier of theJPQLQueryBNFthat will determine how to parse the encapsulated expression.- Specified by:
getQueryBNFIdin classAbstractSingleEncapsulatedExpressionStateObject- Returns:
- The non-
nullID of the BNF
-
getStateObject
Description copied from class:AbstractSingleEncapsulatedExpressionStateObjectReturns the encapsulatedStateObject.- Overrides:
getStateObjectin classAbstractSingleEncapsulatedExpressionStateObject- Returns:
- The encapsulated
StateObject
-
getType
Returns theITypeof the field handled by this object.- Returns:
- Either the
ITypeof the identification variable or theITypeforIType.UNRESOLVABLE_TYPEif it could not be resolved
-
getTypeDeclaration
Returns theITypeDeclarationof the field handled by this object.- Returns:
- Either the
ITypeDeclarationthat was resolved by this object or theITypeDeclarationforIType.UNRESOLVABLE_TYPEif it could not be resolved
-
hasIdentificationVariable
public boolean hasIdentificationVariable()Determines whether the identification variable has been defined or not.- Returns:
trueif the identification variable has been defined;falseotherwise
-
initialize
protected void initialize()Description copied from class:AbstractStateObjectInitializes this state object.- Overrides:
initializein classAbstractStateObject
-
resolveManagedType
Retrieves theIManagedTypethat is mapped to the identification variable, if and only if the identification variable is used to declare an entity.- Returns:
- Either the
IManagedTypedeclared by the identification variable ornullif it could not be resolved
-
resolveType
Resolves theITypeof the property handled by this object.- Returns:
- Either the
ITypethat was resolved by this object or theITypeforIType.UNRESOLVABLE_TYPEif it could not be resolved
-
resolveTypeDeclaration
Resolves theITypeDeclarationof the property handled by this object.- Returns:
- Either the
ITypeDeclarationthat was resolved by this object or theITypeDeclarationforIType.UNRESOLVABLE_TYPEif it could not be resolved
-
setIdentificationVariable
Sets the identification variable of this encapsulated expression.- Parameters:
identificationVariable- The name of the identification variable
-