I have a 3 layer hierarchy A, B, and C
<class name="A" >
<id name="enumItemId" type="int" column="ENUMITEMID">
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">next_value</param>
<param name="max_lo">100</param>
</generator>
</id>
<property name="name" column="NAME" />
<union-subclass name="B" table="B">
<many-to-one name="user" class="User" column="USERID" not-null="true" insert="false" update="false" />
<property name="value" column="VALUE" type="serializable" />
<union-subclass name="C" table="C" />
</union-subclass>
as specified above, user is a required param.
when doing session.save(c), I checked and the attribute user is indeed present, but the insert statement says
insert into C (NAME, VALUE, ENUMITEMID) values (?, ?, ?)
without user.
and I get a
JDBCExceptionReporter:78 - Cannot add or update a child row: a foreign key constraint fails
why is that? did I declare the hbm wrong?
|