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
ThisStateObject
represents 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 java.lang.String
STATE_OBJECT_PROPERTY
Notifies the encapsulatedStateObject
has changed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractSingleEncapsulatedExpression
getExpression()
Returns the actual parsed object if thisStateObject
representation of the JPQL query was created by parsing an existing JPQL query.StateObject
getStateObject()
Returns the encapsulatedStateObject
.boolean
hasStateObject()
Determines whether theStateObject
representing the encapsulated expression is present or not.boolean
isEquivalent(StateObject stateObject)
Determines whether the givenStateObject
is equivalent to this one, i.e.void
parse(java.lang.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 java.lang.String STATE_OBJECT_PROPERTY
Notifies the encapsulatedStateObject
has changed.- See Also:
- Constant Field Values
-
-
Method Detail
-
getExpression
public AbstractSingleEncapsulatedExpression getExpression()
Returns the actual parsed object if thisStateObject
representation of the JPQL query was created by parsing an existing JPQL query.- Specified by:
getExpression
in interfaceStateObject
- Overrides:
getExpression
in classAbstractEncapsulatedExpressionStateObject
- Returns:
- The parsed object when a JPQL query is parsed and converted into a
StateObject
ornull
when 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 theStateObject
representing the encapsulated expression is present or not.- Returns:
true
if the encapsulatedStateObject
is notnull
;false
otherwise
-
isEquivalent
public boolean isEquivalent(StateObject stateObject)
Determines whether the givenStateObject
is equivalent to this one, i.e. the information of bothStateObject
is the same.- Specified by:
isEquivalent
in interfaceStateObject
- Overrides:
isEquivalent
in classAbstractStateObject
- Parameters:
stateObject
- TheStateObject
to compare its content to this one- Returns:
true
if both object are equivalent;false
otherwise
-
parse
public void parse(java.lang.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
-
-