Hi, I've dependent class with bidirectional connection with master object.When I try to create dependents with different foreign keys( from master)
I've got primary key violation on dependent table(that is foreign from master+primary for dependent).Mapping file:
 
 <class name="com.ezan.contract.ContractStore" identity="contract_no">
  <map-to table="contract_tbl"/>
  <field name="contract_no" type="string">
   <sql name="contract_no"/>
  </field>
  <field name="c_name" type="string">
   <sql name="c_name"/>
  </field>
  <field name="stages" collection="vector" type="com.ezan.contract.StageStore">
   <sql many-key="contract_no"/>
  </field>
 </class>
 <class name="com.ezan.contract.StageStore" identity="stage_no" depends="com.ezan.contract.ContractStore">
  <map-to table="stages_tbl"/>
  <field name="contract_no" type="com.ezan.contract.ContractStore">
   <sql name="contract_no"/>
  </field>
  <field name="stage_no" type="integer">
   <sql name="stage_no"/>
  </field>
  <field name="s_name" type="string">
   <sql name="s_name"/>
  </field>
 </class>
Maybe in stagestore need to be noticed contract_no as identity(as it realy is DB-pk is contract_no+stage_no for StageStore)? But if so axiliary contract_no field description is also needed?
And why JBoss implementation searching for add<METHOD>() for correct dependent interpretation but standalone version no such
constraint?Documentation is nothing says about this interface...
 
Thanks.

Reply via email to