some person say:
When using a many-to-many association cascade="all", cascade="delete", and cascade="all-delete-orphans" aren't meaningful. That's because you might delete an instance that can have other parents pointing to it.
If you want to delete rows from the association table (rel_houses_owners) then I would suggest using two one-to-many relationships instead of many-to-many.
You would need one-to-many from owners to house_owners and many-to-one from house_owners to owners. This will allow you to cascade deletes in owner to house_owners without deleting the owner.
Use of many-to-many often leads to the solution described above and is hence discouraged.
posted on 2006-08-29 14:02
R.Zeus 阅读(289)
评论(0) 编辑 收藏 所属分类:
Hibernate