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
{{ message }}
Repository navigation
AbstractMapping.getPersistentEntity(Class<?> type) fails to lookup the PersistentEntity when the provided type is a HibernateProxy #2383
From my analysis, the regression has been added by commit c866b4202527b3acc64e7cc205a98a8aa754cb59 where "ClassTypeInformation now never unwraps the user type to consistently work with the type originally presented in the lookup..."
The assumption in that comment might be incorrect, I would be surprised if PersistentEntity instances are mapped against an HibernateProxy class.
I believe that at least ClassTypeInformation.from(Class type) should have retained the type unwrapping.
This is a minimal demonstrating project which also shows the impact on Spring Data REST demo.zip
The change is more invasive than anticipated. Prior the unwrapping change, looking up the persistent entity using the proxy type worked because ClassTypeInformation unwrapped the type before constructing TypeDiscoverer. That has led to the successful lookup through the proxy. We need to fix this regression.
changed the title [-]AbstractMapping.getPersistentEntity(Class<?> type) fails to lookup the PersistentEntity when the provided type is a HibernateProxy[/-][+]`AbstractMapping.getPersistentEntity(Class<?> type)` fails to lookup the `PersistentEntity` when the provided type is a `HibernateProxy`[/+]on Dec 8, 2021
Activity
mp911de commentedon Nov 24, 2021
The change is more invasive than anticipated. Prior the unwrapping change, looking up the persistent entity using the proxy type worked because
ClassTypeInformationunwrapped the type before constructingTypeDiscoverer. That has led to the successful lookup through the proxy. We need to fix this regression.[-]AbstractMapping.getPersistentEntity(Class<?> type) fails to lookup the PersistentEntity when the provided type is a HibernateProxy[/-][+]`AbstractMapping.getPersistentEntity(Class<?> type)` fails to lookup the `PersistentEntity` when the provided type is a `HibernateProxy`[/+]mp911de commentedon Dec 8, 2021
I transferred the ticket into the JPA project as we can easily fix the issue here.
Polishing.
Unwrap user type when checking if type is JPA-managed.
Polishing.
Unwrap user type when checking if type is JPA-managed.