Hi.
I’m observing a strange behaviour that I’m not able to explain in Hibernate 5.2.17
I have an entity with several oneToMany collections in it.
All these collections are traversable in a bi-directional way
All of them are marked as LazyLoading and Cascade.ALL (we introduced the latter because it helps graphql generation).
When a detached entity of this type is being saved - without changing or accessing any of the associated collections - , hibernate triggers a load (that is fine) but it includes also the first (eg: the entity with the name that is first in lexical ordering) collection in the generated sql.
I do really don’t want to access an associated entity if it was not changed in the code and I expect Lazy Loading to prevent this.
Why Hibernate has this behaviour?
Is there a way to avoid this still using the cascade.all annotation?
Many thanks in advance