cascade « Load « JPA Q&A





1. Hibernate cascading delete with lazy loaded tree nodes    stackoverflow.com

I'm having some issues with cascading delete in my Java Hibernate application. I was wondering if anybody could help me with best practices for cascading on a self referencing table. Basically I have ...

2. cascading and lazy-loading    forum.hibernate.org

How do cascading and lazy-loading interact? More specifically, if I have cascade="refresh" and lazy="true" set on an association (let's say 'children'), then when a parent objects is passed to session.refresh(parent), do the children get loaded if they were not yet loaded and then refresh(child) called for each child, or does the refresh only take place on objects that the session already ...

3. cascade SAVE_UPDATE events called when loading entity WHY?    forum.hibernate.org

I have a Parent/Child relationship with the following mapping for the child. @Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE_ORPHAN}) @EditableProperty(collectionType = AutoComplete.class) @Fetch(value = FetchMode.SELECT) @OneToMany(mappedBy = "autoCompleteSet", fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE}) @Sort(type = SortType.NATURAL) private SortedSet mappings = new TreeSet(); When loading data I see SAVE_UPDATE events being called which do not result in any sql on the database, but, why are ...

5. trouble with cascaded loading    forum.hibernate.org

6. load of unreferenced collection on cascade    forum.hibernate.org

Hi, I am saving an object (default-cascade="persist"), that has multiple collections. Some of these collections were "read" intentionally prior to the save, but others were not. However during persist, the untouched collections get hydrated for no reason I can think of. If they were not touched doesn't that imply that there would be no changes to check for? Or perhaps I ...

7. Eager (left outer join) loading non-distinct cascade entries    forum.hibernate.org

My model class has a cascade relation to one of its child class and the fetch type is eager public class ServiceModelVO implements java.io.Serializable { @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "serviceModel") public Set getFeatureModels() { return this.featureModels; } } When i retreive all the servciemodelVO entries from database Criteria serviceModelCriteria = session.createCriteria(ServiceModelVO .class); serviceModelCriteria .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); List serviceModelList = ...