[jboss-user] [EJB 3.0] - Can't get DELETE_ORPHAN to work with java.persistence.Cascad

c_eric_ray do-not-reply at jboss.com
Thu Aug 3 11:53:29 EDT 2006


I need to annotate a OneToMany relationship like so...


  | @OneToMany(mappedBy="remittancePackage", cascade= {CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
  | 
However, this does not compile becuse the "cascade" parameter is of type java.persitence.CascadeType. How do I do this?

I need this behavior...
anonymous wrote : 
  | If the child object's lifespan is bounded by the lifespan of the parent object, make the parent a full lifecycle object by specifying CascadeType.ALL and org.hibernate.annotations.CascadeType.DELETE_ORPHAN (please refer to the Hibernate reference guide for the semantics of orphan delete)
  | 

And yes, I've read the Hibernate docs. Good for reference but doesn't tell you how to do this in EJB3 with annotations.

Thanks.
Eric Ray

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962905#3962905

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962905



More information about the jboss-user mailing list