Class AbstractSingleEncapsulatedExpressionStateObject
- 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
-
- All Implemented Interfaces:
StateObject
- Direct Known Subclasses:
AbsExpressionStateObject,AggregateFunctionStateObject,AllOrAnyExpressionStateObject,EncapsulatedIdentificationVariableExpressionStateObject,ExistsExpressionStateObject,LengthExpressionStateObject,LowerExpressionStateObject,SizeExpressionStateObject,SqrtExpressionStateObject,SubExpressionStateObject,TrimExpressionStateObject,TypeExpressionStateObject,UpperExpressionStateObject
public abstract class AbstractSingleEncapsulatedExpressionStateObject extends AbstractEncapsulatedExpressionStateObject
ThisStateObjectrepresents a JPQL expression that has a JPQL identifier followed by an encapsulated expression with parenthesis.BNF:expression ::= <identifier>(expression)- Since:
- 2.4
- Version:
- 2.4
- Author:
- Pascal Filion
- See Also:
AbstractSingleEncapsulatedExpression
-
-
Field Summary
Fields Modifier and Type Field Description static StringSTATE_OBJECT_PROPERTYNotifies the encapsulatedStateObjecthas changed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractSingleEncapsulatedExpressiongetExpression()Returns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.StateObjectgetStateObject()Returns the encapsulatedStateObject.booleanhasStateObject()Determines whether theStateObjectrepresenting the encapsulated expression is present or not.booleanisEquivalent(StateObject stateObject)Determines whether the givenStateObjectis equivalent to this one, i.e.voidparse(String jpqlFragment)Parses the given JPQL fragment, which represents the encapsulated expression, and creates theStateObject.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject
getIdentifier
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
addPropertyChangeListener, children, decorate, equals, findIdentificationVariable, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, isDecorated, removePropertyChangeListener, setExpression, setParent, toString, toString, toText
-
Methods inherited from interface org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
accept
-
-
-
-
Field Detail
-
STATE_OBJECT_PROPERTY
public static final String STATE_OBJECT_PROPERTY
Notifies the encapsulatedStateObjecthas changed.- See Also:
- Constant Field Values
-
-
Method Detail
-
getExpression
public AbstractSingleEncapsulatedExpression getExpression()
Returns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.- Specified by:
getExpressionin interfaceStateObject- Overrides:
getExpressionin classAbstractEncapsulatedExpressionStateObject- 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)
-
getStateObject
public StateObject getStateObject()
Returns the encapsulatedStateObject.- Returns:
- The encapsulated
StateObject
-
hasStateObject
public boolean hasStateObject()
Determines whether theStateObjectrepresenting the encapsulated expression is present or not.- Returns:
trueif the encapsulatedStateObjectis notnull;falseotherwise
-
isEquivalent
public boolean isEquivalent(StateObject stateObject)
Determines whether the givenStateObjectis equivalent to this one, i.e. the information of bothStateObjectis the same.- Specified by:
isEquivalentin interfaceStateObject- Overrides:
isEquivalentin classAbstractStateObject- Parameters:
stateObject- TheStateObjectto compare its content to this one- Returns:
trueif both object are equivalent;falseotherwise
-
parse
public void parse(String jpqlFragment)
Parses the given JPQL fragment, which represents the encapsulated expression, and creates theStateObject.- Parameters:
jpqlFragment- The portion of the query representing the encapsulated expression
-
-