| Methods |
public
|
__construct(Query $query)
Creates a new query parser object.
Creates a new query parser object.
Parameters
| $query |
The Query to parse.
|
|
#
|
public
|
setCustomOutputTreeWalker(class-string<SqlWalker> $className): void
Sets a custom tree walker that produces output.
This tree walker will be run last over the AST, after any other walkers.
Sets a custom tree walker that produces output.
This tree walker will be run last over the AST, after any other walkers.
|
#
|
public
|
addCustomTreeWalker(class-string<TreeWalker> $className): void
Adds a custom tree walker for modifying the AST.
Adds a custom tree walker for modifying the AST.
|
#
|
public
|
getLexer(): Lexer
Gets the lexer used by the parser.
Gets the lexer used by the parser.
|
#
|
public
|
getParserResult(): ParserResult
Gets the ParserResult that is being filled with information during parsing.
Gets the ParserResult that is being filled with information during parsing.
|
#
|
public
|
getEntityManager(): EntityManagerInterface
Gets the EntityManager used by the parser.
Gets the EntityManager used by the parser.
|
#
|
public
|
getAST(): SelectStatement|UpdateStatement|DeleteStatement
Parses and builds AST for the given Query.
Parses and builds AST for the given Query.
|
#
|
public
|
match(Lexer::T_* $token): void
Attempts to match the given token with the current lookahead token.
Attempts to match the given token with the current lookahead token.
If they match, updates the lookahead token; otherwise raises a syntax
error.
Parameters
Throws
|
#
|
public
|
free(bool $deep = false, int $position = 0): void
Frees this parser, enabling it to be reused.
Frees this parser, enabling it to be reused.
Parameters
| $deep |
Whether to clean peek and reset errors.
|
| $position |
Position to reset.
|
|
#
|
public
|
parse(): ParserResult
Parses a query string.
|
#
|
private
|
fixIdentificationVariableOrder(SelectStatement|DeleteStatement|UpdateStatement $AST): void
Fixes order of identification variables.
Fixes order of identification variables.
They have to appear in the select clause in the same order as the
declarations (from ... x join ... y join ... z ...) appear in the query
as the hydration process relies on that order for proper operation.
|
#
|
public
|
syntaxError(string $expected = '', DqlToken|null $token = null): void
Generates a new syntax error.
Generates a new syntax error.
Parameters
| $expected |
Expected string.
|
Throws
|
#
|
public
|
semanticalError(string $message = '', DqlToken|null $token = null): void
Generates a new semantical error.
Generates a new semantical error.
Parameters
| $message |
Optional message.
|
Throws
|
#
|
private
|
peekBeyondClosingParenthesis(bool $resetPeek = true): mixed[]
Peeks beyond the matched closing parenthesis and returns the first token after that one.
Peeks beyond the matched closing parenthesis and returns the first token after that one.
Parameters
| $resetPeek |
Reset peek after finding the closing parenthesis.
|
|
#
|
private
|
isMathOperator(DqlToken|null $token): bool
Checks if the given token indicates a mathematical operator.
Checks if the given token indicates a mathematical operator.
|
#
|
private
|
isFunction(): bool
Checks if the next-next (after lookahead) token starts a function.
Checks if the next-next (after lookahead) token starts a function.
Returns
TRUE if the next-next tokens start a function, FALSE otherwise.
|
#
|
private
|
isAggregateFunction(Lexer::T_* $tokenType): bool
Checks whether the given token type indicates an aggregate function.
Checks whether the given token type indicates an aggregate function.
Returns
TRUE if the token type is an aggregate function, FALSE otherwise.
|
#
|
private
|
isNextAllAnySome(): bool
Checks whether the current lookahead token of the lexer has the type T_ALL, T_ANY or T_SOME.
Checks whether the current lookahead token of the lexer has the type T_ALL, T_ANY or T_SOME.
|
#
|
private
|
processDeferredIdentificationVariables(): void
Validates that the given <tt>IdentificationVariable</tt> is semantically correct.
It must exist in query components…
Validates that the given IdentificationVariable is semantically correct.
It must exist in query components list.
|
#
|
private
|
processDeferredNewObjectExpressions(SelectStatement $AST): void
Validates that the given <tt>NewObjectExpression</tt>.
Validates that the given NewObjectExpression.
|
#
|
private
|
processDeferredPartialObjectExpressions(): void
Validates that the given <tt>PartialObjectExpression</tt> is semantically correct.
It must exist in query components…
Validates that the given PartialObjectExpression is semantically correct.
It must exist in query components list.
|
#
|
private
|
processDeferredResultVariables(): void
Validates that the given <tt>ResultVariable</tt> is semantically correct.
It must exist in query components list.
Validates that the given ResultVariable is semantically correct.
It must exist in query components list.
|
#
|
private
|
processDeferredPathExpressions(): void
Validates that the given <tt>PathExpression</tt> is semantically correct for grammar rules:
Validates that the given PathExpression is semantically correct for grammar rules:
AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
StateFieldPathExpression ::= IdentificationVariable "." StateField
SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField
CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField
|
#
|
private
|
processRootEntityAliasSelected(): void
|
#
|
public
|
QueryLanguage(): SelectStatement|UpdateStatement|DeleteStatement
QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement
QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement
|
#
|
public
|
SelectStatement(): SelectStatement
SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
|
#
|
public
|
UpdateStatement(): UpdateStatement
UpdateStatement ::= UpdateClause [WhereClause]
UpdateStatement ::= UpdateClause [WhereClause]
|
#
|
public
|
DeleteStatement(): DeleteStatement
DeleteStatement ::= DeleteClause [WhereClause]
DeleteStatement ::= DeleteClause [WhereClause]
|
#
|
public
|
IdentificationVariable(): string
IdentificationVariable ::= identifier
IdentificationVariable ::= identifier
|
#
|
public
|
AliasIdentificationVariable(): string
AliasIdentificationVariable = identifier
AliasIdentificationVariable = identifier
|
#
|
public
|
AbstractSchemaName(): string
AbstractSchemaName ::= fully_qualified_name | aliased_name | identifier
AbstractSchemaName ::= fully_qualified_name | aliased_name | identifier
|
#
|
private
|
validateAbstractSchemaName(string $schemaName): void
Validates an AbstractSchemaName, making sure the class exists.
Validates an AbstractSchemaName, making sure the class exists.
Parameters
| $schemaName |
The name to validate.
|
Throws
|
#
|
public
|
AliasResultVariable(): string
AliasResultVariable ::= identifier
AliasResultVariable ::= identifier
|
#
|
public
|
ResultVariable(): string
ResultVariable ::= identifier
ResultVariable ::= identifier
|
#
|
public
|
JoinAssociationPathExpression(): JoinAssociationPathExpression
JoinAssociationPathExpression ::= IdentificationVariable "." (CollectionValuedAssociationField |…
JoinAssociationPathExpression ::= IdentificationVariable "." (CollectionValuedAssociationField | SingleValuedAssociationField)
|
#
|
public
|
PathExpression(int-mask-of<PathExpression::TYPE_*> $expectedTypes): PathExpression
Parses an arbitrary path expression and defers semantical validation
based on expected types.
Parses an arbitrary path expression and defers semantical validation
based on expected types.
PathExpression ::= IdentificationVariable {"." identifier}*
|
#
|
public
|
AssociationPathExpression(): PathExpression
AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
|
#
|
public
|
SingleValuedPathExpression(): PathExpression
SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
|
#
|
public
|
StateFieldPathExpression(): PathExpression
StateFieldPathExpression ::= IdentificationVariable "." StateField
StateFieldPathExpression ::= IdentificationVariable "." StateField
|
#
|
public
|
SingleValuedAssociationPathExpression(): PathExpression
SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField
SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField
|
#
|
public
|
CollectionValuedPathExpression(): PathExpression
CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField
CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField
|
#
|
public
|
SelectClause(): SelectClause
SelectClause ::= "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
SelectClause ::= "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
|
#
|
public
|
SimpleSelectClause(): SimpleSelectClause
SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
|
#
|
public
|
UpdateClause(): UpdateClause
UpdateClause ::= "UPDATE" AbstractSchemaName ["AS"] AliasIdentificationVariable "SET" UpdateItem {"," UpdateItem}*
UpdateClause ::= "UPDATE" AbstractSchemaName ["AS"] AliasIdentificationVariable "SET" UpdateItem {"," UpdateItem}*
|
#
|
public
|
DeleteClause(): DeleteClause
DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName ["AS"] AliasIdentificationVariable
DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName ["AS"] AliasIdentificationVariable
|
#
|
public
|
FromClause(): FromClause
FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}*
FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}*
|
#
|
public
|
SubselectFromClause(): SubselectFromClause
SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {","…
SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
|
#
|
public
|
WhereClause(): WhereClause
WhereClause ::= "WHERE" ConditionalExpression
WhereClause ::= "WHERE" ConditionalExpression
|
#
|
public
|
HavingClause(): HavingClause
HavingClause ::= "HAVING" ConditionalExpression
HavingClause ::= "HAVING" ConditionalExpression
|
#
|
public
|
GroupByClause(): GroupByClause
GroupByClause ::= "GROUP" "BY" GroupByItem {"," GroupByItem}*
GroupByClause ::= "GROUP" "BY" GroupByItem {"," GroupByItem}*
|
#
|
public
|
OrderByClause(): OrderByClause
OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
|
#
|
public
|
Subselect(): Subselect
Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
|
#
|
public
|
UpdateItem(): UpdateItem
UpdateItem ::= SingleValuedPathExpression "=" NewValue
UpdateItem ::= SingleValuedPathExpression "=" NewValue
|
#
|
public
|
GroupByItem(): string|PathExpression
GroupByItem ::= IdentificationVariable | ResultVariable | SingleValuedPathExpression
GroupByItem ::= IdentificationVariable | ResultVariable | SingleValuedPathExpression
|
#
|
public
|
OrderByItem(): OrderByItem
OrderByItem ::= (
SimpleArithmeticExpression | SingleValuedPathExpression | CaseExpression |
ScalarExpression…
OrderByItem ::= (
SimpleArithmeticExpression | SingleValuedPathExpression | CaseExpression |
ScalarExpression | ResultVariable | FunctionDeclaration
) ["ASC" | "DESC"]
|
#
|
public
|
NewValue(): ArithmeticExpression|InputParameter|null
NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary |
EnumPrimary |…
NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary |
EnumPrimary | SimpleEntityExpression | "NULL"
NOTE: Since it is not possible to correctly recognize individual types, here is the full
grammar that needs to be supported:
NewValue ::= SimpleArithmeticExpression | "NULL"
SimpleArithmeticExpression covers all *Primary grammar rules and also SimpleEntityExpression
|
#
|
public
|
IdentificationVariableDeclaration(): IdentificationVariableDeclaration
IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {Join}*
IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {Join}*
|
#
|
public
|
SubselectIdentificationVariableDeclaration(): IdentificationVariableDeclaration
SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration
SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration
{Internal note: WARNING: Solution is harder than a bare implementation.
Desired EBNF support:
SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration | (AssociationPathExpression ["AS"] AliasIdentificationVariable)
It demands that entire SQL generation to become programmatical. This is
needed because association based subselect requires "WHERE" conditional
expressions to be injected, but there is no scope to do that. Only scope
accessible is "FROM", prohibiting an easy implementation without larger
changes.}
|
#
|
public
|
Join(): Join
Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN"
(JoinAssociationDeclaration | RangeVariableDeclaration)
…
Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN"
(JoinAssociationDeclaration | RangeVariableDeclaration)
["WITH" ConditionalExpression]
|
#
|
public
|
RangeVariableDeclaration(): RangeVariableDeclaration
RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
Throws
|
#
|
public
|
JoinAssociationDeclaration(): JoinAssociationDeclaration
JoinAssociationDeclaration ::= JoinAssociationPathExpression ["AS"] AliasIdentificationVariable [IndexBy]
JoinAssociationDeclaration ::= JoinAssociationPathExpression ["AS"] AliasIdentificationVariable [IndexBy]
|
#
|
public
|
PartialObjectExpression(): PartialObjectExpression
PartialObjectExpression ::= "PARTIAL" IdentificationVariable "." PartialFieldSet
PartialFieldSet ::= "{"…
PartialObjectExpression ::= "PARTIAL" IdentificationVariable "." PartialFieldSet
PartialFieldSet ::= "{" SimpleStateField {"," SimpleStateField}* "}"
|
#
|
public
|
NewObjectExpression(): NewObjectExpression
NewObjectExpression ::= "NEW" AbstractSchemaName "(" NewObjectArg {"," NewObjectArg}* ")"
NewObjectExpression ::= "NEW" AbstractSchemaName "(" NewObjectArg {"," NewObjectArg}* ")"
|
#
|
public
|
NewObjectArg(): mixed
NewObjectArg ::= ScalarExpression | "(" Subselect ")"
NewObjectArg ::= ScalarExpression | "(" Subselect ")"
|
#
|
public
|
IndexBy(): IndexBy
IndexBy ::= "INDEX" "BY" SingleValuedPathExpression
IndexBy ::= "INDEX" "BY" SingleValuedPathExpression
|
#
|
public
|
ScalarExpression(): mixed
ScalarExpression ::= SimpleArithmeticExpression | StringPrimary | DateTimePrimary |
…
ScalarExpression ::= SimpleArithmeticExpression | StringPrimary | DateTimePrimary |
StateFieldPathExpression | BooleanPrimary | CaseExpression |
InstanceOfExpression
Returns
One of the possible expressions or subexpressions.
|
#
|
public
|
CaseExpression(): mixed
CaseExpression ::= GeneralCaseExpression | SimpleCaseExpression | CoalesceExpression | NullifExpression…
CaseExpression ::= GeneralCaseExpression | SimpleCaseExpression | CoalesceExpression | NullifExpression
GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END"
WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression
SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END"
CaseOperand ::= StateFieldPathExpression | TypeDiscriminator
SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression
CoalesceExpression ::= "COALESCE" "(" ScalarExpression {"," ScalarExpression}* ")"
NullifExpression ::= "NULLIF" "(" ScalarExpression "," ScalarExpression ")"
Returns
One of the possible expressions or subexpressions.
|
#
|
public
|
CoalesceExpression(): CoalesceExpression
CoalesceExpression ::= "COALESCE" "(" ScalarExpression {"," ScalarExpression}* ")"
CoalesceExpression ::= "COALESCE" "(" ScalarExpression {"," ScalarExpression}* ")"
|
#
|
public
|
NullIfExpression(): NullIfExpression
NullIfExpression ::= "NULLIF" "(" ScalarExpression "," ScalarExpression ")"
NullIfExpression ::= "NULLIF" "(" ScalarExpression "," ScalarExpression ")"
|
#
|
public
|
GeneralCaseExpression(): GeneralCaseExpression
GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END"
GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END"
|
#
|
public
|
SimpleCaseExpression(): SimpleCaseExpression
SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END"…
SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END"
CaseOperand ::= StateFieldPathExpression | TypeDiscriminator
|
#
|
public
|
WhenClause(): WhenClause
WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression
WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression
|
#
|
public
|
SimpleWhenClause(): SimpleWhenClause
SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression
SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression
|
#
|
public
|
SelectExpression(): SelectExpression
SelectExpression ::= (
IdentificationVariable | ScalarExpression | AggregateExpression | FunctionDeclaration |
…
SelectExpression ::= (
IdentificationVariable | ScalarExpression | AggregateExpression | FunctionDeclaration |
PartialObjectExpression | "(" Subselect ")" | CaseExpression | NewObjectExpression
) [["AS"] ["HIDDEN"] AliasResultVariable]
|
#
|
public
|
SimpleSelectExpression(): SimpleSelectExpression
SimpleSelectExpression ::= (
StateFieldPathExpression | IdentificationVariable | FunctionDeclaration |
…
SimpleSelectExpression ::= (
StateFieldPathExpression | IdentificationVariable | FunctionDeclaration |
AggregateExpression | "(" Subselect ")" | ScalarExpression
) [["AS"] AliasResultVariable]
|
#
|
public
|
ConditionalExpression(): ConditionalExpression|ConditionalFactor|ConditionalPrimary|ConditionalTerm
ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
|
#
|
public
|
ConditionalTerm(): ConditionalFactor|ConditionalPrimary|ConditionalTerm
ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
|
#
|
public
|
ConditionalFactor(): ConditionalFactor|ConditionalPrimary
ConditionalFactor ::= ["NOT"] ConditionalPrimary
ConditionalFactor ::= ["NOT"] ConditionalPrimary
|
#
|
public
|
ConditionalPrimary(): ConditionalPrimary
ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
|
#
|
public
|
SimpleConditionalExpression(
): BetweenExpression|CollectionMemberExpression|ComparisonExpression|EmptyCollectionComparisonExpression|ExistsExpression|InExpression|InstanceOfExpression|LikeExpression|NullComparisonExpression
SimpleConditionalExpression ::=
ComparisonExpression | BetweenExpression | LikeExpression |
InExpression |…
SimpleConditionalExpression ::=
ComparisonExpression | BetweenExpression | LikeExpression |
InExpression | NullComparisonExpression | ExistsExpression |
EmptyCollectionComparisonExpression | CollectionMemberExpression |
InstanceOfExpression
|
#
|
public
|
EmptyCollectionComparisonExpression(): EmptyCollectionComparisonExpression
EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY"
EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY"
|
#
|
public
|
CollectionMemberExpression(): CollectionMemberExpression
CollectionMemberExpression ::= EntityExpression ["NOT"] "MEMBER" ["OF"] CollectionValuedPathExpression
CollectionMemberExpression ::= EntityExpression ["NOT"] "MEMBER" ["OF"] CollectionValuedPathExpression
EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
SimpleEntityExpression ::= IdentificationVariable | InputParameter
|
#
|
public
|
Literal(): Literal
Literal ::= string | char | integer | float | boolean
Literal ::= string | char | integer | float | boolean
|
#
|
public
|
InParameter(): InputParameter|ArithmeticExpression
InParameter ::= ArithmeticExpression | InputParameter
InParameter ::= ArithmeticExpression | InputParameter
|
#
|
public
|
InputParameter(): InputParameter
InputParameter ::= PositionalParameter | NamedParameter
InputParameter ::= PositionalParameter | NamedParameter
|
#
|
public
|
ArithmeticExpression(): ArithmeticExpression
ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
|
#
|
public
|
SimpleArithmeticExpression(): SimpleArithmeticExpression|ArithmeticTerm
SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
|
#
|
public
|
ArithmeticTerm(): ArithmeticTerm
ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}*
ArithmeticTerm ::= ArithmeticFactor {("" | "/") ArithmeticFactor}
|
#
|
public
|
ArithmeticFactor(): ArithmeticFactor
ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
|
#
|
public
|
ArithmeticPrimary(): Node|string
ArithmeticPrimary ::= SingleValuedPathExpression | Literal | ParenthesisExpression
|…
ArithmeticPrimary ::= SingleValuedPathExpression | Literal | ParenthesisExpression
| FunctionsReturningNumerics | AggregateExpression | FunctionsReturningStrings
| FunctionsReturningDatetime | IdentificationVariable | ResultVariable
| InputParameter | CaseExpression
|
#
|
public
|
StringExpression(): Subselect|Node|string
StringExpression ::= StringPrimary | ResultVariable | "(" Subselect ")"
StringExpression ::= StringPrimary | ResultVariable | "(" Subselect ")"
|
#
|
public
|
StringPrimary(): Node
StringPrimary ::= StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression …
StringPrimary ::= StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression | CaseExpression
|
#
|
public
|
EntityExpression(): InputParameter|PathExpression
EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
|
#
|
public
|
SimpleEntityExpression(): InputParameter|PathExpression
SimpleEntityExpression ::= IdentificationVariable | InputParameter
SimpleEntityExpression ::= IdentificationVariable | InputParameter
|
#
|
public
|
AggregateExpression(): AggregateExpression
AggregateExpression ::=
("AVG" | "MAX" | "MIN" | "SUM" | "COUNT") "(" ["DISTINCT"] SimpleArithmeticExpression ")"
AggregateExpression ::=
("AVG" | "MAX" | "MIN" | "SUM" | "COUNT") "(" ["DISTINCT"] SimpleArithmeticExpression ")"
|
#
|
public
|
QuantifiedExpression(): QuantifiedExpression
QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
|
#
|
public
|
BetweenExpression(): BetweenExpression
BetweenExpression ::= ArithmeticExpression ["NOT"] "BETWEEN" ArithmeticExpression "AND" ArithmeticExpression
BetweenExpression ::= ArithmeticExpression ["NOT"] "BETWEEN" ArithmeticExpression "AND" ArithmeticExpression
|
#
|
public
|
ComparisonExpression(): ComparisonExpression
ComparisonExpression ::= ArithmeticExpression ComparisonOperator ( QuantifiedExpression | ArithmeticExpression )
ComparisonExpression ::= ArithmeticExpression ComparisonOperator ( QuantifiedExpression | ArithmeticExpression )
|
#
|
public
|
InExpression(): InListExpression|InSubselectExpression
InExpression ::= SingleValuedPathExpression ["NOT"] "IN" "(" (InParameter {"," InParameter}* | Subselect) ")"
InExpression ::= SingleValuedPathExpression ["NOT"] "IN" "(" (InParameter {"," InParameter}* | Subselect) ")"
|
#
|
public
|
InstanceOfExpression(): InstanceOfExpression
InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (InstanceOfParameter | "("…
InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (InstanceOfParameter | "(" InstanceOfParameter {"," InstanceOfParameter}* ")")
|
#
|
public
|
InstanceOfParameterList(): non-empty-list<InputParameter|string>
|
#
|
public
|
InstanceOfParameter(): InputParameter|string
InstanceOfParameter ::= AbstractSchemaName | InputParameter
InstanceOfParameter ::= AbstractSchemaName | InputParameter
|
#
|
public
|
LikeExpression(): LikeExpression
LikeExpression ::= StringExpression ["NOT"] "LIKE" StringPrimary ["ESCAPE" char]
LikeExpression ::= StringExpression ["NOT"] "LIKE" StringPrimary ["ESCAPE" char]
|
#
|
public
|
NullComparisonExpression(): NullComparisonExpression
NullComparisonExpression ::= (InputParameter | NullIfExpression | CoalesceExpression | AggregateExpression |…
NullComparisonExpression ::= (InputParameter | NullIfExpression | CoalesceExpression | AggregateExpression | FunctionDeclaration | IdentificationVariable | SingleValuedPathExpression | ResultVariable) "IS" ["NOT"] "NULL"
|
#
|
public
|
ExistsExpression(): ExistsExpression
ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
|
#
|
public
|
ComparisonOperator(): string
ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
|
#
|
public
|
FunctionDeclaration(): FunctionNode
FunctionDeclaration ::= FunctionsReturningStrings | FunctionsReturningNumerics | FunctionsReturningDatetime
FunctionDeclaration ::= FunctionsReturningStrings | FunctionsReturningNumerics | FunctionsReturningDatetime
|
#
|
private
|
CustomFunctionDeclaration(): ?FunctionNode
Helper function for FunctionDeclaration grammar rule.
Helper function for FunctionDeclaration grammar rule.
|
#
|
public
|
FunctionsReturningNumerics(): FunctionNode
FunctionsReturningNumerics ::=
"LENGTH" "(" StringPrimary ")" |
"LOCATE" "(" StringPrimary "," StringPrimary …
FunctionsReturningNumerics ::=
"LENGTH" "(" StringPrimary ")" |
"LOCATE" "(" StringPrimary "," StringPrimary ["," SimpleArithmeticExpression]")" |
"ABS" "(" SimpleArithmeticExpression ")" |
"SQRT" "(" SimpleArithmeticExpression ")" |
"MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")" |
"SIZE" "(" CollectionValuedPathExpression ")" |
"DATE_DIFF" "(" ArithmeticPrimary "," ArithmeticPrimary ")" |
"BIT_AND" "(" ArithmeticPrimary "," ArithmeticPrimary ")" |
"BIT_OR" "(" ArithmeticPrimary "," ArithmeticPrimary ")"
|
#
|
public
|
CustomFunctionsReturningNumerics(): FunctionNode
|
#
|
public
|
FunctionsReturningDatetime(): FunctionNode
FunctionsReturningDateTime ::=
"CURRENT_DATE" |
"CURRENT_TIME" |
"CURRENT_TIMESTAMP" |
"DATE_ADD" "("…
FunctionsReturningDateTime ::=
"CURRENT_DATE" |
"CURRENT_TIME" |
"CURRENT_TIMESTAMP" |
"DATE_ADD" "(" ArithmeticPrimary "," ArithmeticPrimary "," StringPrimary ")" |
"DATE_SUB" "(" ArithmeticPrimary "," ArithmeticPrimary "," StringPrimary ")"
|
#
|
public
|
CustomFunctionsReturningDatetime(): FunctionNode
|
#
|
public
|
FunctionsReturningStrings(): FunctionNode
FunctionsReturningStrings ::=
"CONCAT" "(" StringPrimary "," StringPrimary {"," StringPrimary}* ")" |
"SUBSTRING" "…
FunctionsReturningStrings ::=
"CONCAT" "(" StringPrimary "," StringPrimary {"," StringPrimary}* ")" |
"SUBSTRING" "(" StringPrimary "," SimpleArithmeticExpression "," SimpleArithmeticExpression ")" |
"TRIM" "(" [["LEADING" | "TRAILING" | "BOTH"] [char] "FROM"] StringPrimary ")" |
"LOWER" "(" StringPrimary ")" |
"UPPER" "(" StringPrimary ")" |
"IDENTITY" "(" SingleValuedAssociationPathExpression {"," string} ")"
|
#
|
public
|
CustomFunctionsReturningStrings(): FunctionNode
|
#
|
private
|
getMetadataForDqlAlias(string $dqlAlias): ClassMetadata
|
#
|