[jboss-user] [EJB 3.0] - Re: Foreign key reference with cascading delete

Wolfgang Knauf do-not-reply at jboss.com
Fri Oct 20 07:11:43 EDT 2006


Hi Juergen,

you should change the relation from List to User to a bidirectional one. Something like this:

@OneToMany(cascade=CascadeType.REMOVE)
List getLists(){
...
}

This way, if you delete a user, all Lists are deleted, and also all ListEntries.

Hope this helps

Wolfgang

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

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



More information about the jboss-user mailing list