Class CompoundExpressionStateObject
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject
-
- All Implemented Interfaces:
StateObject
- Direct Known Subclasses:
ArithmeticExpressionStateObject
,ComparisonExpressionStateObject
,LogicalExpressionStateObject
public abstract class CompoundExpressionStateObject extends AbstractStateObject
A compoundStateObject
has a left and right expressions combined by an identifier.BNF:expression ::= left_expression <identifier> right_expression
- Since:
- 2.4
- Version:
- 2.4
- Author:
- Pascal Filion
- See Also:
CompoundExpression
-
-
Field Summary
Fields Modifier and Type Field Description static String
LEFT_STATE_OBJECT_PROPERTY
Notifies the left state object property has changed.static String
RIGHT_STATE_OBJECT_PROPERTY
Notifies the right state object property has changed.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CompoundExpression
getExpression()
Returns the actual parsed object if thisStateObject
representation of the JPQL query was created by parsing an existing JPQL query.abstract String
getIdentifier()
Returns the identifier joining the twoStateObjects
.StateObject
getLeft()
Returns theStateObject
that represents the left expression.StateObject
getRight()
Returns theStateObject
that represents the right expression.boolean
hasLeft()
Determines whether there is aStateObject
that represents the left expression.boolean
hasRight()
Determines whether there is aStateObject
that represents the right expression.boolean
isEquivalent(StateObject stateObject)
Determines whether the givenStateObject
is equivalent to this one, i.e.void
parseLeft(String jpqlFragment)
Parses the given JPQL fragment and update the left side of the compound expression.void
parseRight(String jpqlFragment)
Parses the given JPQL fragment and update the right side of the compound expression.void
setLeft(StateObject leftStateObject)
Sets the leftStateObject
to become the given object.void
setRight(StateObject rightStateObject)
Sets the rightStateObject
to become the given object.-
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
-
LEFT_STATE_OBJECT_PROPERTY
public static final String LEFT_STATE_OBJECT_PROPERTY
Notifies the left state object property has changed.- See Also:
- Constant Field Values
-
RIGHT_STATE_OBJECT_PROPERTY
public static final String RIGHT_STATE_OBJECT_PROPERTY
Notifies the right state object property has changed.- See Also:
- Constant Field Values
-
-
Method Detail
-
getExpression
public CompoundExpression 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 classAbstractStateObject
- 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)
-
getIdentifier
public abstract String getIdentifier()
Returns the identifier joining the twoStateObjects
.- Returns:
- The JPQL identifier join two expressions
-
getLeft
public StateObject getLeft()
Returns theStateObject
that represents the left expression.- Returns:
- The
StateObject
representing the left expression
-
getRight
public StateObject getRight()
Returns theStateObject
that represents the right expression.- Returns:
- The
StateObject
representing the right expression
-
hasLeft
public boolean hasLeft()
Determines whether there is aStateObject
that represents the left expression.- Returns:
true
if there is a leftStateObject
;false
if it isnull
-
hasRight
public boolean hasRight()
Determines whether there is aStateObject
that represents the right expression.- Returns:
true
if there is a rightStateObject
;false
if it isnull
-
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
-
parseLeft
public void parseLeft(String jpqlFragment)
Parses the given JPQL fragment and update the left side of the compound expression.- Parameters:
jpqlFragment
- The portion of the query to become the left side of the compound expression
-
parseRight
public void parseRight(String jpqlFragment)
Parses the given JPQL fragment and update the right side of the compound expression.- Parameters:
jpqlFragment
- The portion of the query to become the right side of the compound expression
-
setLeft
public void setLeft(StateObject leftStateObject)
Sets the leftStateObject
to become the given object.- Parameters:
leftStateObject
- TheStateObject
representing the left expression
-
setRight
public void setRight(StateObject rightStateObject)
Sets the rightStateObject
to become the given object.- Parameters:
rightStateObject
- TheStateObject
representing the right expression
-
-