-
Notifications
You must be signed in to change notification settings - Fork 683
Parameter.getType()
returns erased generic type for method parameters
#2995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Parameter.getType()
returns erased generic type for method parameters
Thanks for reporting the issue. It seems that Hibernate started verifying the parameter type that we have used for quite some while incorrectly. Method parameter types using a generic type have been reduced to their type erasure which is We need to fix the issue by providing the enclosing type to our method parameters so that we can resolve the correct value type. |
@mp911de thank you! |
@ryerrappa @spring-projects-issues |
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
The text was updated successfully, but these errors were encountered: