Skip to content

BadJpqlGrammarException with attribute labelled 'type' #3062

@gpolet

Description

@gpolet

Similarly to #3028, sping-data-jpa throws BadJpqlGrammarException: Line 1:33 no viable alternative at input 'e.type'; Bad JPQL grammar [select e from Employee e where e.type = :_type]

public interface EmployeeRepository extends JpaRepository<Employee, Long> {

    @Query("select e from Employee e where e.type = :_type")
    List<Employee> failingQuery(@Param("_type") String name);
}

Prior sping-data-jpa 3.1.0 query was working (it also seems that named parameters that are matching reserved keywords, eg: type, date, from, ..., also make the parsing crash, unlike allowed prior v3.1.0)

Metadata

Metadata

Assignees

Labels

in: query-parserEverything related to parsing JPQL or SQLtype: regressionA regression from a previous release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions