-
Notifications
You must be signed in to change notification settings - Fork 561
Related entity rendered differently depending on JPA fetch type [DATAREST-1494] #1813
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
Oliver Drotbohm commented We cannot control the serialization of object instances produced by Hibernate but AFAIR, the Jackson Hibernate module should make work proxies OOTB. Are you using that? |
jvanheesch commented I was not.
If I change the
Notice that in the first case, author has a |
Oliver Drotbohm commented Are you able to produce a minimal reproducing project so that I can investigate? |
jvanheesch commented I had made such project, but apparently I forgot to link it.
If in class
|
Oliver Drotbohm commented Unfortunately this seems to be an issue in Jackson's Hibernate 5 module. Whether to unwrap or not involves a lookup in the target serializer which the In general I think the fundamental problem shouldn't be that ubiquitous as entities internal to the aggregate (i.e. references to other non-aggregate) should be mapped to eagerly load by default. There's simply no point in delaying the loading as Jackson will need them to render them anyway |
jvanheesch commented Thank you for proposing a fix for that issue!
|
jvanheesch commented The bug in Jackson's Hibernate 5 module has been fixed (com.fasterxml.jackson.datatype:jackson-datatype-hibernate5:jar:2.11.2). |
Oliver Drotbohm commented Resolving as suggested as it's fixed in an upstream project |
jvanheesch opened DATAREST-1494 and commented
Please see reference url for quick reproducer.
On branch
master
:curl [http://localhost:8080/books/]
results inFor us this is currently non-blocking, as we use the following workaround:
This issue seems very similar to https://jira.spring.io/browse/DATAREST-1442, although
seems not to apply here
Reference URL: https://github.com/jvanheesch/spring-data-rest-bytebuddyinterceptor
1 votes, 2 watchers
The text was updated successfully, but these errors were encountered: