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

public Class ModExpressionStateObject

extends AbstractDoubleEncapsulatedExpressionStateObject
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.parser.ModExpression, .SimpleArithmeticExpressionBNF

The modulo operation finds the remainder of division of one number by another.

It takes two integer arguments and returns an integer.

BNF: expression ::= MOD(simple_arithmetic_expression, simple_arithmetic_expression)

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
ModExpression

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject:
FIRST_STATE_OBJECT_PROPERTYSECOND_STATE_OBJECT_PROPERTY

Constructor Summary

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

Creates a new ModExpressionStateObject.

public
ModExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject
The StateObject representing the first expression
firstStateObject
,
StateObject
The StateObject representing the second expression
secondStateObject
)

Creates a new ModExpressionStateObject.

public
ModExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The string representation of the first encapsulated expression to parse and to convert into a StateObject representation
firstJpqlFragment
,
String
The string representation of the second encapsulated expression to parse and to convert into a StateObject representation
secondJpqlFragment
)

Creates a new ModExpressionStateObject.

Method Summary

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

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.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.
protected String
getFirstQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getFirstQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the first encapsulated expression.
public String
protected String
getSecondQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getSecondQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the second encapsulated expression.
public void
setExpression(ModExpression
The parsed object representing a MOD 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.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject:
addChildrengetFirstgetSecondhasFirsthasSecondisEquivalentparseFirstparseSecondsetFirstsetSecondtoTextEncapsulatedExpression

Constructor Detail

ModExpressionStateObjectback to summary
public ModExpressionStateObject(StateObject parent)

Creates a new ModExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
ModExpressionStateObjectback to summary
public ModExpressionStateObject(StateObject parent, StateObject firstStateObject, StateObject secondStateObject)

Creates a new ModExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

firstStateObject:StateObject

The StateObject representing the first expression

secondStateObject:StateObject

The StateObject representing the second expression

Exceptions
NullPointerException:
The given parent cannot be null
ModExpressionStateObjectback to summary
public ModExpressionStateObject(StateObject parent, String firstJpqlFragment, String secondJpqlFragment)

Creates a new ModExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

firstJpqlFragment:String

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

secondJpqlFragment:String

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

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 ModExpression getExpression()

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

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
getFirstQueryBNFIdback to summary
protected String getFirstQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getFirstQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getFirstQueryBNFId.

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

Returns:String

The query BNF ID for the first encapsulated expression

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
getSecondQueryBNFIdback to summary
protected String getSecondQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getSecondQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getSecondQueryBNFId.

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

Returns:String

The query BNF ID for the second encapsulated expression

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

The parsed object representing a MOD expression