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 compoundStateObjecthas 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 StringLEFT_STATE_OBJECT_PROPERTYNotifies the left state object property has changed.static StringRIGHT_STATE_OBJECT_PROPERTYNotifies the right state object property has changed.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CompoundExpressiongetExpression()Returns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.abstract StringgetIdentifier()Returns the identifier joining the twoStateObjects.StateObjectgetLeft()Returns theStateObjectthat represents the left expression.StateObjectgetRight()Returns theStateObjectthat represents the right expression.booleanhasLeft()Determines whether there is aStateObjectthat represents the left expression.booleanhasRight()Determines whether there is aStateObjectthat represents the right expression.booleanisEquivalent(StateObject stateObject)Determines whether the givenStateObjectis equivalent to this one, i.e.voidparseLeft(String jpqlFragment)Parses the given JPQL fragment and update the left side of the compound expression.voidparseRight(String jpqlFragment)Parses the given JPQL fragment and update the right side of the compound expression.voidsetLeft(StateObject leftStateObject)Sets the leftStateObjectto become the given object.voidsetRight(StateObject rightStateObject)Sets the rightStateObjectto 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 thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.- Specified by:
getExpressionin interfaceStateObject- Overrides:
getExpressionin classAbstractStateObject- 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)
-
getIdentifier
public abstract String getIdentifier()
Returns the identifier joining the twoStateObjects.- Returns:
- The JPQL identifier join two expressions
-
getLeft
public StateObject getLeft()
Returns theStateObjectthat represents the left expression.- Returns:
- The
StateObjectrepresenting the left expression
-
getRight
public StateObject getRight()
Returns theStateObjectthat represents the right expression.- Returns:
- The
StateObjectrepresenting the right expression
-
hasLeft
public boolean hasLeft()
Determines whether there is aStateObjectthat represents the left expression.- Returns:
trueif there is a leftStateObject;falseif it isnull
-
hasRight
public boolean hasRight()
Determines whether there is aStateObjectthat represents the right expression.- Returns:
trueif there is a rightStateObject;falseif it isnull
-
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
-
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 leftStateObjectto become the given object.- Parameters:
leftStateObject- TheStateObjectrepresenting the left expression
-
setRight
public void setRight(StateObject rightStateObject)
Sets the rightStateObjectto become the given object.- Parameters:
rightStateObject- TheStateObjectrepresenting the right expression
-
-