I'm having problems with the delete-orphan option and a non-null constraint on a map property. The Map maps a string to another "child" entity. When I remove an item from the Map and save the parent entity, I get the following error:
Caused by: java.sql.SQLException: Attempt to insert null into a non-nullable column: column: NAME table: TASK_TAG in statement [update task_tag set task_id=null, name=null where task_id=?]
In this case, TASK_TAG is the table for the child entity.
My question here, is why is hibernate trying to set all columns to null? Shouldn't it just try to delete the orphaned child entry? I've set cascase="all, delete-orphan" on the <map/> element in the parent entity.
This is hibernate core 3.2.6.
Thank you for the help.
Scott
|