Skip to content
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

Proxy class detection for Hibernate 5 fails [DATAREST-1322]

Closed
spring-projects-issues opened this issue Dec 19, 2018 · 3 comments
Closed
Assignees
Labels
type: bug

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Dec 19, 2018

alienisty opened DATAREST-1322 and commented

Proxies in Hibernate are no longer created using CGLIB and they use a different class separator.

Becuase of that, Hibernate proxied classes are not unproxied when looking up, for example, for ResourceMetadata, and we get the wrong information back.

For example, hrefs for links of lazy loaded relationships end up using the default rel because the correct mapping is not found and, if we defined a custom rel in the repository, incorrect href will be generated


Affects: 3.1.3 (Lovelace SR3)

Issue Links:

Referenced from: commits 13370f8, 747a949, 15056f1

Backported to: 3.1.4 (Lovelace SR4), 3.0.13 (Kay SR13)

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Dec 19, 2018

alienisty commented

I just found out that spring-data-common has the concept of ProxyDetectors, I think that the use of ClassUtils.getUserClass() should be replaced by ProxyUtils.getUserClass() across the board in spring-data

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Dec 19, 2018

alienisty commented

I've also noted that the spring-data-rest-partent pom still references hibernate 4.3.10.Final as version to test against, it would probably be a good idea to upgrade that as well

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Dec 20, 2018

Oliver Drotbohm commented

That's in place. I've fixed the Hibernate upgrade in DATAREST-1325 as we cannot back-port this unfortunately. However, the fix for this ticket here can be back-ported and thus make Spring Data REST projects on Kay and Lovelace Hibernate 5.x compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug
Projects
None yet
Development

No branches or pull requests

2 participants