Skip to content

EqlParser prohibits the use of reserved words (JPQL aggregate functions) in entity field names #3829

Closed
@sazonov

Description

@sazonov

Attached you will find a reproducer that implements a sample application with JPA Entity "Item" containing field "size" and corresponding repository ItemRepository. The repository contains only one method with query select sum(i.size) from Item i.
Running this app leads to error org.springframework.data.jpa.repository.query.BadJpqlGrammarException: At 1:13 and token 'size', no viable alternative at input 'select sum(i.*size) from Item i'; Bad EQL grammar [select sum(i.size) from Item i].
If the field 'size' is renamed to 'sizeInBytes' the app is running with no errors.
If a query parser is switched to HqlParser the app is running fine as well.

EQLParseError.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions