goeh wrote:
But it fails on insert of LOOKUPDESCRIPTION. The OWNER column is NULL. I have tried to set the OWNER column myself but I dont know where to set it.
I solved it!
This is how the mapping looks like on all 20 lookup tables:
Code:
<set
name="descriptions"
table="LOOKUPDESCRIPTION"
lazy="false"
inverse="true"
cascade="all"
>
<key
column="OWNER"
/>
<one-to-many
class="foo.bar.LookupDescription"
/>
</set>
But I still have to set OWNER myself. I do that with onSave(Session) in all parent classes (abstract super class).
At first I could not get this to work, but I had mixed up the return values from the Lifecycle methods. I returned true (sounded reasonable). But reading the manual word by word I found out that you should return false from those methods if you dont want to veto the operation.
Now it works as I want it to work, great!
/Goran