ObjectMapperCustomizer with Hibernate5Module for lazyloading
See original GitHub issueDescribe the bug Jackson ObjectMapperCustomizer not working as expected.
Expected behavior If the Hibernate5Module would be set with the Hibernate5Module.Feature.SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS feature, i would expect that on every jax-rs endpoint with the jackson module would use the given Objectmapper feature. So that lazy loaded relations would shown only as id lists.
Actual behavior Getting Lazyloading execptions.
To Reproduce Steps to reproduce the behavior:
- Clone https://github.com/cerias/quarkus-debug-jackson-objectmapper
- setup database with one entity of TestA and TestB
- Open /swagger-ui and trigger GET
Configuration
also in the example repo.
Environment (please complete the following information):
-
Output of
uname -a
orver
: Linux huffelpuff 5.1.1-050101-generic #201905110631 SMP Sat May 11 06:33:50 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux -
Output of
java -version
: OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing) -
GraalVM version (if different from Java): 19.0.2
-
Quarkus version or git rev: 0.25
It is also possible im not using the hibernate feature wrong. 😉
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:25 (9 by maintainers)
Is there some plan to resolve this?
We also need this feature in our project. We need Proxys to be ignored from Serialization. Thanks!
– Edit:
Is there any way of using this method in quarkus?:
Hibernate.isInitialized(entity.getCollection()).
It always returns true in my case. If we have a way to check if the collection is initialized or not, we can implement a custom serializer.
Thanks