Hi,
I have two tables X and Y and the mapping for Y contains depends="X".
This was done so that insert into X automatically inserts into Y. The problem
is that I want to insert a record into X, retrieve a sequence generated key and
use it in the insert into Y. From the log file, I see that insert is attempted into Y
first and when if doesn't find the key, it complains..
I have copied part of the mapping file below..
Pls help.
-Bhaskar
<class name="com.mhub.core.busobj.Group" identity="id" key-generator="functionkey">
<description>Group</description>
<cache-type type="none"/>
<map-to table="FUNCTION"/>
<field name="id" type="long">
<sql name="function_id" read- type="integer" dirty="ignore"/>
</field>
<field name="sections" type="com.mhub.core.busobj.GroupSection" collection="vector">
<sql many-key="group_id"/>
</field>
</class>
<class name="com.mhub.core.busobj.GroupSection" identity="groupId sectionId priority" depends="com.mhub.core.busobj.Group">
<description>Group Section</description>
<cache-type type="none"/>
<map-to table="SECTION_GROUP"/>
<field name="groupId" type="long">
<sql name="GROUP_ID" type="integer"/>
</field>
<field name="sectionId" type="long">
<sql name="SECTION_ID" type="integer"/>
</field>
<field name="priority" type="long">
<sql name="PRIORITY" type="integer"/>
</field>
</class>
