Closed
Description
Hi, I've found the following problem when using Spring Data JPA 3.1.1 with Hibernate 6.2.5.Final:
@Repository
@ApplicationScope
public interface SomeDao extends JpaRepository<SomeDbo, Long> {
@Query("select t.name from SomeDbo t where t.name LIKE :name escape '\\'")
List<String> findNamesLike(@Param("name") String name);
// ...
}
Which causes the exception:
BadJpqlGrammarException: Line 1:63 token recognition error at: ''\'; Bad JPQL grammar
[select t.name from SomeDbo t where t.name LIKE :name escape '\']
This worked fine with Spring Data JPA 2.7.10 + Hibernate 5.6.14.Final. I don't see any Hibernate-related code in the stacktrace, so I assume that's the validation on the Spring side.