I have 2 classes: Msg
and Task
, which are 1-to-1.
If I try to save an Msg instance without installing a Task instance for it, I get.
org.hibernate.PropertyValueException: not-null property references a null or transient value: entity3.Msg.task
How to enable saving Msg without a task? I have this in the mapping file for Msg, but that doesn't help
<many-to-one class="entity3.Task" fetch="select" name="task" not-null="false"> <column name="TaskID" not-null="true" unique="true"/> </many-to-one>
Thanks in advance!
source share