Cascade « Default « JPA Q&A





1. Cascade all by default, but how to switch it off in code??    forum.hibernate.org

Hi, I've got a hibernate class 'issue' with a property which gets a collection of 'regions' set to cascade="all", and this works fine. Each time I do a query for 'issue' it also queries to get the associated 'regions'. But I also want to trawl through all 'issues' and archive them. I don't need the associated 'regions' when doing this, so ...

2. Default cascade in Hibernate 3    forum.hibernate.org

Hi I was wondering how to define default or global cascade settings in Hibernate 3 ? I would like to set it to save-update globally which will get overwritten if necessary for a given component. I checked hibernate-mapping.hbm.vm where I can hard code default-cascade in hibernate-mapping tag but was wondering if there is any better way of doing it ? Thanks ...

3. Cascade none (default) does not prevent updates    forum.hibernate.org

Newbie Joined: Mon Jul 02, 2007 1:46 am Posts: 3 OK, I've finally gotten around to making a little test case for this. I have two entities: Parent and Child. Code: @Entity public class Parent implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) ...

4. How to set the default cascade style in EJB3?    forum.hibernate.org

I have googled and searched the documentation to no avail. How do I set the default-cascade property in EJB3? I expect it's a property in persistence.xml but for the life of me I cannot find the property name anywhere. It could be just default-cascade but given the other property names I've seen I'm doubtful (but very willing to be wrong :-). ...