Top Description Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.model.query

public Class OrExpressionStateObject

extends LogicalExpressionStateObject
Class Inheritance
Static Imports
org.eclipse.persistence.jpa.jpql.parser.Expression.OR

The OR logical operator chains multiple criteria together. A valid operand of an OR operator must be one of: TRUE, FALSE, and NULL. The OR operator has a lower precedence than the AND operator.

NULL represents unknown. Therefore, if one operand is NULL and the other operand is TRUE the result is TRUE, because one TRUE operand is sufficient for a TRUE result. If one operand is NULL and the other operand is either FALSE or NULL, the result is NULL (unknown).

The following table shows how the OR operator is evaluated based on its two operands:
TRUEFALSENULL
TRUETRUETRUETRUE
FALSETRUEFALSENULL
NULLTRUENULLNULL

BNF: conditional_expression ::= conditional_expression OR conditional_term

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
OrExpression

Constructor Summary

AccessConstructor and Description
public
OrExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
)

Creates a new OrExpressionStateObject.

public
OrExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject
The StateObject representing the left expression
leftStateObject
,
StateObject
The StateObject representing the right expression
rightStateObject
)

Creates a new OrExpressionStateObject.

public
OrExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The string representation of the left expression to parse and to convert into a StateObject
leftJpqlFragment
,
String
The string representation of the right expression to parse and to convert into a StateObject
rightJpqlFragment
)

Creates a new OrExpressionStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
public OrExpression
getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.LogicalExpressionStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
public String
protected String
getLeftQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject.getLeftQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the left side of the expression.
protected String
getRightQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject.getRightQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the right side of the expression.
public void
setExpression(OrExpression
The parsed object representing a logical OR expression
expression
)

Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.

Constructor Detail

OrExpressionStateObjectback to summary
public OrExpressionStateObject(StateObject parent)

Creates a new OrExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
OrExpressionStateObjectback to summary
public OrExpressionStateObject(StateObject parent, StateObject leftStateObject, StateObject rightStateObject)

Creates a new OrExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

leftStateObject:StateObject

The StateObject representing the left expression

rightStateObject:StateObject

The StateObject representing the right expression

Exceptions
NullPointerException:
The given parent cannot be null
OrExpressionStateObjectback to summary
public OrExpressionStateObject(StateObject parent, String leftJpqlFragment, String rightJpqlFragment)

Creates a new OrExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

leftJpqlFragment:String

The string representation of the left expression to parse and to convert into a StateObject

rightJpqlFragment:String

The string representation of the right expression to parse and to convert into a StateObject

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

acceptback to summary
public void accept(StateObjectVisitor visitor)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.accept.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.accept.

Visits this StateObject by the given visitor.

Parameters
visitor:StateObjectVisitor

The visitor to visit this object

Annotations
@Override
getExpressionback to summary
public OrExpression getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.LogicalExpressionStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.

Returns:OrExpression

The parsed object when a JPQL query is parsed and converted into a StateObject or null when the JPQL query is manually created (i.e. not from a string)

Annotations
@Override
getIdentifierback to summary
public String getIdentifier()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject.getIdentifier.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject.getIdentifier.

Returns the identifier joining the two StateObjects.

Returns:String

The JPQL identifier join two expressions

Annotations
@Override
getLeftQueryBNFIdback to summary
protected String getLeftQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject.getLeftQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject.getLeftQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the left side of the expression.

Returns:String

The query BNF ID for the left side of the expression

Annotations
@Override
getRightQueryBNFIdback to summary
protected String getRightQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject.getRightQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject.getRightQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the right side of the expression.

Returns:String

The query BNF ID for the right side of the expression

Annotations
@Override
setExpressionback to summary
public void setExpression(OrExpression expression)

Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.

Parameters
expression:OrExpression

The parsed object representing a logical OR expression