Using Hibernate, I usually default collection "cascade" attribute to "all-delete-orphan". The allows me to not care about cascading at all, and let Hibernate do everything.
However, if you want to move an object from one parent to another (in my case, say a peep is removed from a FarmTile and added to a BoardTile or a Card), you will get an exception like "deleted object would be re-saved by cascade (remove deleted object from associations".
To solve this, simply change the 'all-delete-orphan" to "all" - which means you will need to manually delete orphans if you need them deleted though.
dimanche 18 avril 2010
Inscription à :
Publier les commentaires (Atom)
You might be interested in my project
RépondreSupprimerwww.agricolaonline.com
I have actually neared completion of an online version of Agricola.
Has the development for the Agricola project ended? If it hasn't I would like to see what I could do to help!
RépondreSupprimer