Top Description Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.parser

public final Class SubstringExpression

extends AbstractTripleEncapsulatedExpression
Class Inheritance

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])

JPA 2.1:
BNF ::= SUBSTRING(string_expression, arithmetic_expression [, arithmetic_expression])
Example: UPDATE Employee e SET e.firstName = SUBSTRING('TopLink Workbench', 1, 8)
Author
Pascal Filion
Since
2.3
Version
2.5

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression:
parameterIndex

Constructor Summary

AccessConstructor and Description
public
SubstringExpression(AbstractExpression
The parent of this expression
parent
)

Creates a new SubstringExpression.

Method Summary

Modifier and TypeMethod and Description
public void
accept(ExpressionVisitor
The ExpressionVisitor to visit this object
visitor
)

Implements org.eclipse.persistence.jpa.jpql.parser.Expression.accept.

Visits this Expression by the given visitor.
public String
getParameterQueryBNFId(int
The position of the encapsulated Expression that needs to be parsed within the parenthesis, which starts at position 0
index
)

Implements abstract org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression.getParameterQueryBNFId.

Returns the unique identifier of the JPQLQueryBNF to be used to parse one of the encapsulated expression at the given position.
public JPQLQueryBNF
protected boolean
isThirdExpressionOptional()

Implements abstract org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression.isThirdExpressionOptional.

Determines whether the third expression is an optional expression, which means a valid query can have it or not.
Inherited from org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression:
acceptChildrenaddChildrenToaddOrderedEncapsulatedExpressionTobuildCollectionExpressionfindQueryBNFgetFirstExpressiongetSecondExpressiongetThirdExpressionhasEncapsulatedExpressionhasFirstCommahasFirstExpressionhasSecondCommahasSecondExpressionhasSpaceAfterFirstCommahasSpaceAfterSecondCommahasThirdExpressionisParsingCompleteparseEncapsulatedExpressionremoveEncapsulatedExpressiontoParsedTextEncapsulatedExpression

Constructor Detail

SubstringExpressionback to summary
public SubstringExpression(AbstractExpression parent)

Creates a new SubstringExpression.

Parameters
parent:AbstractExpression

The parent of this expression

Method Detail

acceptback to summary
public void accept(ExpressionVisitor visitor)

Implements org.eclipse.persistence.jpa.jpql.parser.Expression.accept.

Doc from org.eclipse.persistence.jpa.jpql.parser.Expression.accept.

Visits this Expression by the given visitor.

Parameters
visitor:ExpressionVisitor

The ExpressionVisitor to visit this object

Annotations
@Override
getParameterQueryBNFIdback to summary
public String getParameterQueryBNFId(int index)

Implements abstract org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression.getParameterQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression.getParameterQueryBNFId.

Returns the unique identifier of the JPQLQueryBNF to be used to parse one of the encapsulated expression at the given position.

Parameters
index:int

The position of the encapsulated Expression that needs to be parsed within the parenthesis, which starts at position 0

Returns:String

The ID of the JPQLQueryBNF to be used to parse one of the encapsulated expression

Annotations
@Override
getQueryBNFback to summary
public JPQLQueryBNF getQueryBNF()

Implements org.eclipse.persistence.jpa.jpql.parser.Expression.getQueryBNF.

Doc from org.eclipse.persistence.jpa.jpql.parser.Expression.getQueryBNF.

Returns the BNF of this Expression.

Returns:JPQLQueryBNF

The JPQLQueryBNF, which represents the grammar of this Expression

Annotations
@Override
isThirdExpressionOptionalback to summary
protected boolean isThirdExpressionOptional()

Implements abstract org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression.isThirdExpressionOptional.

Doc from org.eclipse.persistence.jpa.jpql.parser.AbstractTripleEncapsulatedExpression.isThirdExpressionOptional.

Determines whether the third expression is an optional expression, which means a valid query can have it or not.

Returns:boolean

true if the third expression can either be present or not in a valid query; false if it's mandatory

Annotations
@Override