spring-projects / spring-data-jpa

Simplifies the development of creating a JPA-based data access layer.
https://spring.io/projects/spring-data-jpa/
Apache License 2.0
2.93k stars 1.39k forks source link

Fix parsing entity names in JPQL query with package names that contain reserved words #3457

Closed christophstrobl closed 2 months ago

christophstrobl commented 2 months ago

Resolves: #3451

jgooley-sh commented 2 months ago

Not sure if this PR handles the reserved words anywhere in the query, but I found that the table alias couldn't be the reserved word either.

select exp
from Experience exp
mp911de commented 2 months ago

Not sure if this PR handles the reserved words anywhere in the query, but I found that the table alias couldn't be the reserved word either.

It isn't intended but permits reserved words as per JPA spec, identifiers are:

Reserved identifiers must not be used as identification variables or result variables

Isn't the purpose of reserved words that you cannot use these in arbitrary places?