Hey, Andy,
I had similar problem just yesterday!
In our case, we were mapping 2 tables with "unidirectional" one-to-many association on foreign key. Based
on the Hibernate reference document, quote from 7.2.3
"A unidirectional one-to-many association on a foreign key is a very unusual case,
and is not really recommended." Looks like Hibernate really doesn't like this type of association
or database design - for some reason, Hibernate will issue "update to set to null" and this
will fail if you define the foreign key column in the child table to be "not null"
Hmm...I am not convinced it is "very unusual"....and there is nothing wrong to define the
foreign key column to be NOT NULL based on our business logic....
Anyway, the mapping files in our approach are very like those in the reference
doc:
in the parent class mapping file, have "not-null"="true" in the key column
and remove the defination of the foreign key property from the child mapping file (otherwise we
had duplicate mapping error)
JY