You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the Spring Framework issue, the LocalVariableTableParameterNameDiscoverer was completely removed. As a result, the Spring Data JPA project cannot recognize the parameters of constructors for class-based projections in DTO classes that do not include parameter names in the compiled bytecode (i.e., classes compiled without the -parameters flag).
When using such DTO classes from a third-party dependency JAR, the parameter names appear as arg0, arg1, etc. The DefaultParameterNameDiscoverer now only utilizes StandardReflectionParameterNameDiscoverer, which cannot handle these parameter names. Previously, a warning would have been logged for such cases.
I have prepared an example project to demonstrate the issue.
The text was updated successfully, but these errors were encountered:
We rely entirely on Spring's infrastructure to correlate property names to constructor arg names. With the removal of LocalVariableTableParameterNameDiscoverer, there's nothing we can do here really. ReturnedClass.detectConstructorParameterNames doesn't check for parameter absence, so we could introduce some logging to indicate improper usage. I'm moving the ticket into Spring Data Commons as that is the place where projection infrastructure comes from.
We now skip unnamed DTO projection properties and issue a warning log to raise awareness.
Skipping unnamed (null) properties avoids identification as DTO and only selects properties stemming from named constructor arguments.
Add tests for Kotlin data classes using value classes for verification.
Closes#3225
We now skip unnamed DTO projection properties and issue a warning log to raise awareness.
Skipping unnamed (null) properties avoids identification as DTO and only selects properties stemming from named constructor arguments.
Add tests for Kotlin data classes using value classes for verification.
Closes#3225
According to the Spring Framework issue, the LocalVariableTableParameterNameDiscoverer was completely removed. As a result, the Spring Data JPA project cannot recognize the parameters of constructors for class-based projections in DTO classes that do not include parameter names in the compiled bytecode (i.e., classes compiled without the -parameters flag).
When using such DTO classes from a third-party dependency JAR, the parameter names appear as arg0, arg1, etc. The DefaultParameterNameDiscoverer now only utilizes StandardReflectionParameterNameDiscoverer, which cannot handle these parameter names. Previously, a warning would have been logged for such cases.
I have prepared an example project to demonstrate the issue.
The text was updated successfully, but these errors were encountered: