Closed clementdenis closed 1 year ago
Until the HQL parser gets updated for Hibernate 6.2, is there a way to disable the query parser for specific queries?
There isn't any way to disable the query parser.
You can work around this with a custom implementation. Check out https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.custom-implementations for more details on how to hook such a solution into your repository.
However, it won't take long for me to add support.
Merged to main
and backported to 3.1.x
.
Hi @gregturn / @clementdenis can you please point me to examples of using CTE with Spring Data JPA + Hibernate. I am getting exception
Caused by: org.hibernate.query.sqm.EntityTypeException: Could not resolve entity name 'samCTE'
More Details on https://stackoverflow.com/questions/78004995/cte-usage-with-spring-data-jpa-3-2-hibernate-6-4-does-not-work . Hibernate Query checks is expecting to define an Entity for name of CTE .
polite bump
Thank you @Aniket-Singla / @CatPlanet for getting in touch - We prefer to use GitHub issues only for bugs and enhancements. If you encounter problems with the data-jpa integration (something that cannot be reproduced with plain hibernate) please create a new issue, potentially linking to this closed one. Also make sure to provide more context - ideally take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.
Hibernate 6.2 introduced CTE support.
But in Spring Data JPA 3.1 (that depends on Hibernate 6.2); such queries are rejected by the HQL parser:
My query here works just fine when creating the query directly with the entity manager.