I search one way to use JsonIgnore (or just return an empty array) when my assotiation variable with fetch = FetchType.LAZY isn’t initialize and use my own serializer when it is. I tryed to do test in …
Tag: lazy-loading
Using Spring data JPA EntityGraph with LAZY load mode for NamedAttributeNode field
I am facing with 2 problems: N + 1 query and Out Of Memory (OOM). I solved OOM by paging and lazy loading: But when I use lazy loading, N + 1 query happened. So I try to use EntityGraph as https://www.baeldung.com/spring-data-jpa-named-entity-graphs. But as my researches and local test, EntityGraph always do eager loading for NamedAttributeNode field – association field,
Is Java 8 stream laziness useless in practice?
I have read a lot about Java 8 streams lately, and several articles about lazy loading with Java 8 streams specifically: here and over here. I can’t seem to shake the feeling that lazy loading is COMPLETELY useless (or at best, a minor syntactic convenience offering zero performance value). Let’s take this code as an example: This will log in
How to convert a Hibernate proxy to a real entity object
During a Hibernate Session, I am loading some objects and some of them are loaded as proxies due to lazy loading. It’s all OK and I don’t want to turn lazy loading off. But later I need to send some of the objects (actually one object) to the GWT client via RPC. And it happens that this concrete object is