-
Notifications
You must be signed in to change notification settings - Fork 677
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
PropertyAccessingMethodInterceptor
fails with IllegalStateException
when target method is bridged
#3215
Comments
This is an interesting effect of mixed visibilities. Looking at the byte code, the compiler generates a Interestingly, if we align visibilities (all I think we could filter synthetic methods if we walk the inheritance tree to mitigate the issue. |
Duplicate of #3159 |
PropertyAccessingMethodInterceptor
fails with IllegalStateException
when target method is bridged
…a bridge method. We now skip synthetic bridge methods when resolving a PropertyDescriptor from a called interface method on the target type and resolve the bridged method. Closes #3215
…a bridge method. We now skip synthetic bridge methods when resolving a PropertyDescriptor from a called interface method on the target type and resolve the bridged method. Closes #3215
I have used Spring Data JPA DTO interface-based projection many times and it worked just fine.
But yesterday I came across an interesting issue that is happening only under certain specific combination such as follows:
I have a
BaseEntity
as follows:I have a JPA entity
Post
extendingBaseEntity
class as follows:I have created a Interface Projections as follows:
Now I have PostRepository as follows:
The problem: When I get
List<PostProjection>
by callingpostRepository.findAllBy()
, everything is working fine. But when I getList<PostProjection>
by callingpostRepository.findAllPosts()
and then try to accesspostProjection.getCreatedAt()
method then it is throwing the following Exception:Observations:
BaseEntity
)@Query("...")
Here is a minimal reproducer: https://github.com/siva-attic/spring-data-jpa-projection-issue
The text was updated successfully, but these errors were encountered: