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

public Class LocalDateTime

extends AbstractExpression
Class Inheritance
Imports
java.util.Collection, .List, java.util.function.Supplier, org.eclipse.persistence.jpa.jpql.WordParser

The DATE | TIME | DATETIME argument of LOCAL local_datetime_type expression.
Jakarta Persistence 3.1:
BNF: local_datetime_type ::= DATE | ..... matches Java java.time.LocalDate TIME | ..... matches Java java.time.LocalTime DATETIME ..... matches Java java.time.LocalDateTime

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
LocalDateTime.Identifier

Local date/time type identifier.

Field Summary

Modifier and TypeField and Description
private LocalDateTime.Identifier
identifier

The actual local_datetime_type identifier found in the string representation of the JPQL query.

Inherited from org.eclipse.persistence.jpa.jpql.parser.AbstractExpression:
COMMADOTDOUBLE_QUOTELEFT_CURLY_BRACKETLEFT_PARENTHESISNOT_DEFINEDRIGHT_CURLY_BRACKETRIGHT_PARENTHESISSINGLE_QUOTESPACEUNDERSCORE

Constructor Summary

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

Creates a new LocalExpression.

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 void
acceptChildren(ExpressionVisitor
The visitor to visit the children of this object.
visitor
)

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

Visits the children of this Expression.
protected void
addChildrenTo(Collection<Expression>
The collection used to store the children
children
)

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.addChildrenTo.

Adds the children of this AbstractExpression to the given collection.
protected void
addOrderedChildrenTo(List<Expression>
The list used to store the string representation of this AbstractExpression
children
)

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.addOrderedChildrenTo.

Adds the children of this AbstractExpression to the given list.
public JPQLQueryBNF
public <R> R
getValueByType(Supplier<R>
function executed for LOCAL DATE
dateAction
,
Supplier<R>
function executed for LOCAL TIME
timeAction
,
Supplier<R>
function executed for LOCAL DATETIME
dateTimeAction
)

Execute supplier depending on local date/time text identifier in LocalDateTime expression.

protected void
parse(final 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
)

Implements abstract org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.parse.

Parses the query by starting at the current position, which is part of the given WordParser.
public void
runByType(Runnable
function executed for LOCAL DATE
dateAction
,
Runnable
function executed for LOCAL TIME
timeAction
,
Runnable
function executed for LOCAL DATETIME
dateTimeAction
)

Execute action depending on local date/time text identifier in LocalDateTime expression.

public String
toActualText()

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.toActualText.

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

Generates a string representation of this Expression, which needs to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist.
protected void
toParsedText(StringBuilder
The buffer used to append this Expression's string representation
writer
,
boolean
Determines whether the string representation should represent what was parsed, i.e. include any "virtual" whitespace (such as ending whitespace) and the actual case of the JPQL identifiers
actual
)

Implements abstract org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.toParsedText.

Generates a string representation of this Expression, including its children, if it has any.
Inherited from org.eclipse.persistence.jpa.jpql.parser.AbstractExpression:
acceptUnknownVisitoracceptUnknownVisitorbuildExpressionFromFallingBackbuildNullExpressionbuildStringExpressionbuildStringExpressionbuildUnknownExpressioncalculatePositionchildrenfindFallBackExpressionFactoryfindQueryBNFgetExpressionFactorygetExpressionRegistrygetGrammargetIdentifierVersiongetJPAVersiongetLengthgetOffsetgetParentgetQueryBNFgetRootgetTexthandleAggregatehandleCollectionisAncestorisIdentifierisNullisParsingCompleteisTolerantisUnknownisVirtualorderedChildrenparseparseUsingExpressionFactorypopulatePositionrebuildActualTextrebuildParsedTextsetParentsetTextshouldParseWithFactoryFirstshouldSkipLiteraltoParsedTexttoString

Field Detail

identifierback to summary
private LocalDateTime.Identifier identifier

The actual local_datetime_type identifier found in the string representation of the JPQL query.

Constructor Detail

LocalDateTimeback to summary
public LocalDateTime(AbstractExpression parent)

Creates a new LocalExpression.

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
acceptChildrenback to summary
public void acceptChildren(ExpressionVisitor visitor)

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

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

Visits the children of this Expression. This method can be used to optimize traversing the children since a new list is not created every time children() is called.

This does not traverse the Expression sub-hierarchy, use a subclass of AbstractTraverseChildrenVisitor in order to traverse the entire sub-hierarchy.

Parameters
visitor:ExpressionVisitor

The visitor to visit the children of this object.

Annotations
@Override
addChildrenToback to summary
protected void addChildrenTo(Collection<Expression> children)

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.addChildrenTo.

Doc from org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.addChildrenTo.

Adds the children of this AbstractExpression to the given collection.

Parameters
children:Collection<Expression>

The collection used to store the children

Annotations
@Override
addOrderedChildrenToback to summary
protected void addOrderedChildrenTo(List<Expression> children)

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.addOrderedChildrenTo.

Doc from org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.addOrderedChildrenTo.

Adds the children of this AbstractExpression to the given list.

Parameters
children:List<Expression>

The list used to store the string representation of this AbstractExpression

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
getValueByTypeback to summary
public <R> R getValueByType(Supplier<R> dateAction, Supplier<R> timeAction, Supplier<R> dateTimeAction)

Execute supplier depending on local date/time text identifier in LocalDateTime expression.

Parameters
dateAction:Supplier<R>

function executed for LOCAL DATE

timeAction:Supplier<R>

function executed for LOCAL TIME

dateTimeAction:Supplier<R>

function executed for LOCAL DATETIME

parseback to summary
protected void parse(final WordParser wordParser, boolean tolerant)

Implements abstract org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.parse.

Doc from org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.parse.

Parses the query by starting at the current position, which is part of the given WordParser.

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

Annotations
@Override
runByTypeback to summary
public void runByType(Runnable dateAction, Runnable timeAction, Runnable dateTimeAction)

Execute action depending on local date/time text identifier in LocalDateTime expression.

Parameters
dateAction:Runnable

function executed for LOCAL DATE

timeAction:Runnable

function executed for LOCAL TIME

dateTimeAction:Runnable

function executed for LOCAL DATETIME

toActualTextback to summary
public String toActualText()

Overrides org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.toActualText.

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

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

Generates a string representation of this Expression, which needs to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist.

Returns:String

The string representation of this Expression

Annotations
@Override
toParsedTextback to summary
protected void toParsedText(StringBuilder writer, boolean actual)

Implements abstract org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.toParsedText.

Doc from org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.toParsedText.

Generates a string representation of this Expression, including its children, if it has any.

Parameters
writer:StringBuilder

The buffer used to append this Expression's string representation

actual:boolean

Determines whether the string representation should represent what was parsed, i.e. include any "virtual" whitespace (such as ending whitespace) and the actual case of the JPQL identifiers

Annotations
@Override
org.eclipse.persistence.jpa.jpql.parser back to summary

private final Enum LocalDateTime.Identifier

extends Enum<LocalDateTime.Identifier>
Class Inheritance

Local date/time type identifier.

Field Summary

Modifier and TypeField and Description
public static final LocalDateTime.Identifier
DATE

"DATE" type identifier.

public static final LocalDateTime.Identifier
DATETIME

"DATETIME" type identifier.

private final String
public static final LocalDateTime.Identifier
TIME

"TIME" type identifier.

Constructor Summary

AccessConstructor and Description
private
Identifier(final String name)

Method Summary

Modifier and TypeMethod and Description
private static final LocalDateTime.Identifier

Returns:

Identifier matching local date/time text identifier or null when identifier is unknown.
getIdentifier
(final String
local date/time text identifier
name
)

Convert local date/time text identifier to Identifier.

private static LocalDateTime.Identifier

Returns:

local date/time type identifier
parse
(final WordParser
source JPQL parser
wordParser
)

Parse identifier (DATE/DATETIME/TIME) at current parser position.

public static LocalDateTime.Identifier
public static LocalDateTime.Identifier[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DATEback to summary
public static final LocalDateTime.Identifier DATE

"DATE" type identifier.

DATETIMEback to summary
public static final LocalDateTime.Identifier DATETIME

"DATETIME" type identifier.

nameback to summary
private final String name

Hides java.lang.Enum.name.

TIMEback to summary
public static final LocalDateTime.Identifier TIME

"TIME" type identifier.

Constructor Detail

Identifierback to summary
private Identifier(final String name)

Method Detail

getIdentifierback to summary
private static final LocalDateTime.Identifier getIdentifier(final String name)

Convert local date/time text identifier to Identifier. Conversion is case insensitive.

Parameters
name:String

local date/time text identifier

Returns:LocalDateTime.Identifier

Identifier matching local date/time text identifier or null when identifier is unknown.

parseback to summary
private static LocalDateTime.Identifier parse(final WordParser wordParser)

Parse identifier (DATE/DATETIME/TIME) at current parser position. Determines proper identifier with minimal cost. Input always contains DATE | DATETIME | TIME so no exact matching is required

Parameters
wordParser:WordParser

source JPQL parser

Returns:LocalDateTime.Identifier

local date/time type identifier

valueOfback to summary
public static LocalDateTime.Identifier valueOf(String name)
valuesback to summary
public static LocalDateTime.Identifier[] values()