d0yao wrote:
if I changed insert='true", I got the following error:
net.sf.hibernate.MappingException: Repeated column in mapping for class C should be mapped with insert="false" update="false": ID_Column
at net.sf.hibernate.persister.AbstractEntityPersister.checkColumnDuplication(AbstractEntityPersister.java:1009)
I guess it is due to the fact that ID_Column is the primary key for P class/table also.
can you post the complete mapping for the child?
Quote:
From my understanding, the deletion is working since cascade="all" has the same effect as cascade="delete" from the deletion point view. ("all" covers "delete"). If I changed cascade="save-update", the deletion will fail.
hmmm, I thought you meant the row was actually deleted, and didn't just have it's parent key set to null, making it an orphan, which is why "all-delete-orphan" is used.