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

public Class IndexExpressionStateObject

extends EncapsulatedIdentificationVariableExpressionStateObject
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.parser.IndexExpression

The INDEX function returns an integer value corresponding to the position of its argument in an ordered list. The INDEX function can only be applied to identification variables denoting types for which an order column has been specified.

BNF: expression ::= INDEX(identification_variable)

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
IndexExpression

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.EncapsulatedIdentificationVariableExpressionStateObject:
IDENTIFICATION_VARIABLE_PROPERTY

Constructor Summary

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

Creates a new IndexExpressionStateObject.

public
IndexExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The name of the identification variable
identificationVariable
)

Creates a new IndexExpressionStateObject.

Method Summary

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

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.EncapsulatedIdentificationVariableExpressionStateObject.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
public void
setExpression(IndexExpression
The parsed object representing an INDEX 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.EncapsulatedIdentificationVariableExpressionStateObject:
checkIntegrityclearResolvedObjectsgetIdentificationVariablegetManagedTypegetQueryBNFIdgetStateObjectgetTypegetTypeDeclarationhasIdentificationVariableinitializeresolveManagedTyperesolveTyperesolveTypeDeclarationsetIdentificationVariable

Constructor Detail

IndexExpressionStateObjectback to summary
public IndexExpressionStateObject(StateObject parent)

Creates a new IndexExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
IndexExpressionStateObjectback to summary
public IndexExpressionStateObject(StateObject parent, String identificationVariable)

Creates a new IndexExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

identificationVariable:String

The name of the identification variable

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

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

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
setExpressionback to summary
public void setExpression(IndexExpression 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:IndexExpression

The parsed object representing an INDEX expression