I have two audited entities, A and B. Entity A holds a collection of entity B (annotated as One-to-many relationship). When inserting a new instance of A into the database, all
In Hibernate we could control the loading of children by specifying lazy. So, you need to add the below line to your class definition in hibernate configuration for it to load all the associations in both read/write cases.
If you have marked CacheMode.REFRESH then it will write items to the second-level cache. Do not read from the second-level cache.
If you don't have issues in loading the children at the time of parent you could turn of lazy which will return the updated information.