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

public Class AllOrAnyExpressionStateObject

extends AbstractSingleEncapsulatedExpressionStateObject
Class Inheritance
Annotations
@SuppressWarnings:nls
Imports
org.eclipse.persistence.jpa.jpql.Assert, org.eclipse.persistence.jpa.jpql.parser.AllOrAnyExpression, .SubqueryBNF

An ALL conditional expression is a predicate that is true if the comparison operation is true for all values in the result of the subquery or the result of the subquery is empty. An ALL conditional expression is false if the result of the comparison is false for at least one row, and is unknown if neither true nor false.

An ANY conditional expression is a predicate that is true if the comparison operation is true for some value in the result of the subquery. An ANY conditional expression is false if the result of the subquery is empty or if the comparison operation is false for every value in the esult of the subquery, and is unknown if neither true nor false. The keyword SOME is synonymous with ANY. The comparison operators used with ALL or ANY conditional expressions are =, <, <=, >, >=, <>. The result of the subquery must be like that of the other argument to the comparison operator in type.

BNF: all_or_any_expression ::= {ALL|ANY|SOME}(subquery)

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
AllOrAnyExpression

Field Summary

Modifier and TypeField and Description
private String
identifier

The actual JPQL identifier: ALL, ANY or SOME.

public static final String
IDENTIFIER_PROPERTY

Notifies the identifier property has changed.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject:
STATE_OBJECT_PROPERTY

Constructor Summary

AccessConstructor and Description
public
AllOrAnyExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
One of the three possible JPQL identifiers: ALL, ANY or SOME
identifier
)

Creates a new AllOrAnyExpressionStateObject.

public
AllOrAnyExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
One of the three possible JPQL identifiers: ALL, ANY or SOME
identifier
,
StateObject
The StateObject representing the encapsulated expression
stateObject
)

Creates a new AllOrAnyExpressionStateObject.

public
AllOrAnyExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
One of the three possible JPQL identifiers: ALL, ANY or SOME
identifier
,
String
The portion of the query representing the encapsulated expression
jpqlFragment
)

Creates a new AllOrAnyExpressionStateObject.

Method Summary

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

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.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
getQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getQueryBNFId.

Returns the unique identifier of the JPQLQueryBNF that will determine how to parse the encapsulated expression.
public boolean
isEquivalent(StateObject
The StateObject to compare its content to this one
stateObject
)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.isEquivalent.

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

Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.
public void
setExpression(AllOrAnyExpression
The parsed object representing an ALL, ANY or SOME 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.

public void
setIdentifier(String
One of the three possible JPQL identifiers: ALL, ANY or SOME
identifier
)

Sets the JPQL identifier to the given one.

public void
setStateObject(StateObject
The new encapsulated StateObject
stateObject
)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.setStateObject.

Sets the given StateObject to represent the new encapsulated expression.
private void
Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject:
addChildrengetStateObjecthasStateObjectparsetoTextEncapsulatedExpression

Field Detail

identifierback to summary
private String identifier

The actual JPQL identifier: ALL, ANY or SOME.

IDENTIFIER_PROPERTYback to summary
public static final String IDENTIFIER_PROPERTY

Notifies the identifier property has changed.

Constructor Detail

AllOrAnyExpressionStateObjectback to summary
public AllOrAnyExpressionStateObject(StateObject parent, String identifier)

Creates a new AllOrAnyExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

identifier:String

One of the three possible JPQL identifiers: ALL, ANY or SOME

Exceptions
AssertException:
The given JPQL identifier is one from the possible choices
NullPointerException:
The given parent cannot be null
AllOrAnyExpressionStateObjectback to summary
public AllOrAnyExpressionStateObject(StateObject parent, String identifier, StateObject stateObject)

Creates a new AllOrAnyExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

identifier:String

One of the three possible JPQL identifiers: ALL, ANY or SOME

stateObject:StateObject

The StateObject representing the encapsulated expression

Exceptions
AssertException:
The given JPQL identifier is one from the possible choices
NullPointerException:
The given parent cannot be null
AllOrAnyExpressionStateObjectback to summary
public AllOrAnyExpressionStateObject(StateObject parent, String identifier, String jpqlFragment)

Creates a new AllOrAnyExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

identifier:String

One of the three possible JPQL identifiers: ALL, ANY or SOME

jpqlFragment:String

The portion of the query representing the encapsulated expression

Exceptions
AssertException:
The given JPQL identifier is one from the possible choices
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 AllOrAnyExpression getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.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:AllOrAnyExpression

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.AbstractEncapsulatedExpressionStateObject.getIdentifier.

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

Returns the JPQL identifier of the expression represented by this AbstractSingleEncapsulatedExpressionStateObject.

Returns:String

The JPQL identifier that is shown before the left parenthesis

Annotations
@Override
getQueryBNFIdback to summary
protected String getQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.getQueryBNFId.

Returns the unique identifier of the JPQLQueryBNF that will determine how to parse the encapsulated expression.

Returns:String

The non-null ID of the BNF

Annotations
@Override
isEquivalentback to summary
public boolean isEquivalent(StateObject stateObject)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.isEquivalent.

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

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

Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.

Parameters
stateObject:StateObject

The StateObject to compare its content to this one

Returns:boolean

true if both object are equivalent; false otherwise

Annotations
@Override
setExpressionback to summary
public void setExpression(AllOrAnyExpression 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:AllOrAnyExpression

The parsed object representing an ALL, ANY or SOME expression

setIdentifierback to summary
public void setIdentifier(String identifier)

Sets the JPQL identifier to the given one.

Parameters
identifier:String

One of the three possible JPQL identifiers: ALL, ANY or SOME

Exceptions
AssertException:
The given JPQL identifier is one from the possible choices
setStateObjectback to summary
public void setStateObject(StateObject stateObject)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.setStateObject.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject.setStateObject.

Sets the given StateObject to represent the new encapsulated expression.

Parameters
stateObject:StateObject

The new encapsulated StateObject

Annotations
@Override
validateIdentifierback to summary
private void validateIdentifier(String identifier)