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.98k stars 1.41k forks source link

JPQL and HQL parser issue with class projection when FQDN includes "exp" #3451

Closed jgooley-sh closed 5 months ago

jgooley-sh commented 5 months ago

Version: Latest 3.1.x

It appears that when using class based projection we can't have exp in our package name.

select new com.company.exp.thing.stuff.ClassName(
  e.id,
  cast(round(coalesce(SUM(e.amount), 0),2) as decimal) as amountTotal
)
from Experience e
group by e.id

Antlr output:

line 1:22 mismatched input '.' expecting '(' line 1:32 mismatched input '.' expecting {, ',', EXCEPT, FROM, GROUP, INTERSECT, ORDER, UNION, WHERE}

christophstrobl commented 5 months ago

@jgooley-sh thanks for reporting - we'll look into this.