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

public Class SubstringExpressionStateObject

extends AbstractTripleEncapsulatedExpressionStateObject
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.parser.SimpleArithmeticExpressionBNF, .StringPrimaryBNF, .SubstringExpression

The second and third arguments of the SUBSTRING function denote the starting position and length of the substring to be returned. These arguments are integers. The first position of a string is denoted by 1. The SUBSTRING function returns a string.

JPA 1.0:

BNF ::= SUBSTRING(string_primary, simple_arithmetic_expression, simple_arithmetic_expression)
JPA 2.0:
BNF ::= SUBSTRING(string_primary, simple_arithmetic_expression [, simple_arithmetic_expression])
Author
Pascal Filion
Since
2.4
Version
2.4
See Also
SubstringExpression

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTripleEncapsulatedExpressionStateObject:
FIRST_STATE_OBJECT_PROPERTYSECOND_STATE_OBJECT_PROPERTYTHIRD_STATE_OBJECT_PROPERTY

Constructor Summary

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

Creates a new SubstringExpressionStateObject.

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

Creates a new SubstringExpressionStateObject.

public
SubstringExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject
The StateObject of the first expression
firstStateObject
,
StateObject
The StateObject of the second expression
secondStateObject
,
StateObject
The StateObject of the third encapsulated expression
thirdStateObject
)

Creates a new SubstringExpressionStateObject.

public
SubstringExpressionStateObject(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 SubstringExpressionStateObject.

public
SubstringExpressionStateObject(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
,
String
The string representation of the third encapsulated expression to parse and to convert into a StateObject representation
thirdJpqlFragment
)

Creates a new SubstringExpressionStateObject.

Method Summary

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

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTripleEncapsulatedExpressionStateObject.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.AbstractTripleEncapsulatedExpressionStateObject.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.AbstractTripleEncapsulatedExpressionStateObject.getSecondQueryBNFId.

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

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTripleEncapsulatedExpressionStateObject.getThirdQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the third encapsulated expression.
public void
setExpression(SubstringExpression
The parsed object representing a SUBSTRING 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.AbstractTripleEncapsulatedExpressionStateObject:
addChildrengetFirstgetSecondgetThirdhasFirsthasSecondhasThirdisEquivalentparseFirstparseSecondparseThirdsetFirstsetSecondsetThirdtoTextEncapsulatedExpression

Constructor Detail

SubstringExpressionStateObjectback to summary
public SubstringExpressionStateObject(StateObject parent)

Creates a new SubstringExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

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

Creates a new SubstringExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

firstStateObject:StateObject

The StateObject of the first expression

secondStateObject:StateObject

The StateObject of the second expression

Exceptions
NullPointerException:
The given parent cannot be null
SubstringExpressionStateObjectback to summary
public SubstringExpressionStateObject(StateObject parent, StateObject firstStateObject, StateObject secondStateObject, StateObject thirdStateObject)

Creates a new SubstringExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

firstStateObject:StateObject

The StateObject of the first expression

secondStateObject:StateObject

The StateObject of the second expression

thirdStateObject:StateObject

The StateObject of the third encapsulated expression

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

Creates a new SubstringExpressionStateObject.

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
SubstringExpressionStateObjectback to summary
public SubstringExpressionStateObject(StateObject parent, String firstJpqlFragment, String secondJpqlFragment, String thirdJpqlFragment)

Creates a new SubstringExpressionStateObject.

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

thirdJpqlFragment:String

The string representation of the third 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 SubstringExpression getExpression()

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

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.AbstractTripleEncapsulatedExpressionStateObject.getFirstQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTripleEncapsulatedExpressionStateObject.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.AbstractTripleEncapsulatedExpressionStateObject.getSecondQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTripleEncapsulatedExpressionStateObject.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
getThirdQueryBNFIdback to summary
protected String getThirdQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTripleEncapsulatedExpressionStateObject.getThirdQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTripleEncapsulatedExpressionStateObject.getThirdQueryBNFId.

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

Returns:String

The query BNF ID for the third encapsulated expression

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

The parsed object representing a SUBSTRING expression