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

public final Class DatabaseType

extends AbstractDoubleEncapsulatedExpression
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.WordParser

This expression represents the database specific data type, which may include size and scale.
BNF: database_type ::= data_type_literal [( [numeric_literal [, numeric_literal]] )]
BNF: data_type_literal ::= [CHAR, VARCHAR, NUMERIC, INTEGER, DATE, TIME, TIMESTAMP, etc]

Example: CASE(e.name AS VARCHAR(20))

Author
Pascal Filion
Since
2.4
Version
2.5

Constructor Summary

AccessConstructor and Description
public
DatabaseType(AbstractExpression
The parent of this expression
parent
,
String
The database type
databaseType
)

Creates a new DatabaseType.

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 JPQLQueryBNF
protected boolean
public String
parameterExpressionBNF(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.AbstractDoubleEncapsulatedExpression.parameterExpressionBNF.

Returns the BNF to be used to parse one of the encapsulated expression.
protected boolean
shouldParseRightParenthesis(WordParser
The text to parse based on the current position of the cursor
wordParser
,
boolean
Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
tolerant
)

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractEncapsulatedExpression.shouldParseRightParenthesis.

Determines whether the right parenthesis should be parsed or not by this expression.
Inherited from org.eclipse.persistence.jpa.jpql.parser.AbstractDoubleEncapsulatedExpression:
acceptChildrenaddChildrenToaddOrderedEncapsulatedExpressionTobuildCollectionExpressionfindQueryBNFgetFirstExpressiongetSecondExpressionhasCommahasEncapsulatedExpressionhasFirstExpressionhasSecondExpressionhasSpaceAfterCommaisParsingCompleteparseEncapsulatedExpressionremoveEncapsulatedExpressiontoParsedTextEncapsulatedExpression

Constructor Detail

DatabaseTypeback to summary
public DatabaseType(AbstractExpression parent, String databaseType)

Creates a new DatabaseType.

Parameters
parent:AbstractExpression

The parent of this expression

databaseType:String

The database type

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
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
isSecondExpressionOptionalback to summary
protected boolean isSecondExpressionOptional()

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractDoubleEncapsulatedExpression.isSecondExpressionOptional.

Doc from org.eclipse.persistence.jpa.jpql.parser.AbstractDoubleEncapsulatedExpression.isSecondExpressionOptional.

Determines whether the second expression is optional or not.

Returns:boolean

true if the second expression is optional; false if it is required

Annotations
@Override
parameterExpressionBNFback to summary
public String parameterExpressionBNF(int index)

Implements abstract org.eclipse.persistence.jpa.jpql.parser.AbstractDoubleEncapsulatedExpression.parameterExpressionBNF.

Doc from org.eclipse.persistence.jpa.jpql.parser.AbstractDoubleEncapsulatedExpression.parameterExpressionBNF.

Returns the BNF to be used to parse one of the encapsulated expression.

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 BNF to be used to parse one of the encapsulated expression

Annotations
@Override
shouldParseRightParenthesisback to summary
protected boolean shouldParseRightParenthesis(WordParser wordParser, boolean tolerant)

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractEncapsulatedExpression.shouldParseRightParenthesis.

Doc from org.eclipse.persistence.jpa.jpql.parser.AbstractEncapsulatedExpression.shouldParseRightParenthesis.

Determines whether the right parenthesis should be parsed or not by this expression. There is a possible case where this expression should have optional left and right parenthesis. If there is no left parenthesis, then it would most likely mean the right parenthesis does not belong to this expression.

Parameters
wordParser:WordParser

The text to parse based on the current position of the cursor

tolerant:boolean

Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries

Returns:boolean

true if the right parenthesis should be owned by this expression if it is the next character to scan; false otherwise

Annotations
@Override