Issues with Spring Data JPA repositores after upgrading to Spring Boot 3.2.0 and Hibernate 6.4. Failed to create query when using generics #38635
Labels
for: external-project
For an external project and not something we can fix
status: invalid
An issue that we don't feel is valid
Hello, I've been facing a fatal exception during application startup upon upgrading to Spring Boot 3.2.
The error message is
It seems to be related to using generics in JPA repositories.
Sample Application
Here is a link to a minimal application that reproduces the issue: https://github.com/ryerrappa/spring-data-jpa-generics-issue
There is also a branch in the above repo called
working
that shows a working application using a previous version of spring boot. Please note in the branchworking
, the application will still auto-shutdown, however the application starts up successfully.This issue occurs when using the following:
The issue did not occur when using the following:
Code causing issue
RelatedToUserJpaRepository.java
ManyEntitiesToOneUserJpaRepository.java
StuffRepository.java
Error message
Failed to create query for method public abstract long com.example.jparepodemo.dao.RelatedToUserJpaRepository.deleteByIdAndUser_Username(java.lang.Object,java.lang.String); Cannot compare left expression of type 'java.lang.Long' with right expression of type 'java.lang.Object'
The text was updated successfully, but these errors were encountered: