Hi 

 Is the reference-descriptor in a 1-M mapping requried for a proper 1-M
mapping ?

I have an OrderTO object that can hold a collection of AdjustmentTO
objects
here is my descriptor mapping (notice, no reference mapping in the
child class)

------------------------------------------------------------descriptor
start-----------------------------------------------------------------------
<class-descriptor
class="com.anasi.application.feecalculation.entities.OrderTO" 
table="ORDER">
<field-descriptor name="id" column="ID" jdbc-type="INTEGER"
conversion="org.apache.ojb.broker.accesslayer.conversions.Int2IntegerFieldConversion"
primarykey="true" autoincrement="true"/>
<field-descriptor name="orderState" column="ORDERSTATE"
jdbc-type="INTEGER"/>
<field-descriptor name="payerId" column="PAYER_ID"
jdbc-type="BIGINT"/>
<field-descriptor name="payeeId" column="PAYEE_ID"
jdbc-type="BIGINT"/>
<field-descriptor name="orderAmount" column="ORDERAMOUNT"
jdbc-type="DOUBLE" precision="5" scale="2"/>
<field-descriptor name="orderDate" column="ORDERDATE" jdbc-type="DATE"
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion"/>
 <collection-descriptor name="adjustments"
element-class-ref="com.anasi.application.feecalculation.entities.AdjustmentTO"
orderby="entryDate" sort="DESC" auto-retrieve="true" auto-update="true"
auto-delete="true" refresh="true" >
         <inverse-foreignkey field-ref="orderId"/>
</collection-descriptor>
</class-descriptor>
 <class-descriptor
class="com.anasi.application.feecalculation.entities.AdjustmentTO" 
table="ADJUSTMENT">
  <field-descriptor name="id" column="ID" jdbc-type="INTEGER"
conversion="org.apache.ojb.broker.accesslayer.conversions.Int2IntegerFieldConversion"
primarykey="true" autoincrement="true"/>
      <field-descriptor name="reasonId" column="REASON_ID"
jdbc-type="BIGINT"/>
      <field-descriptor name="orderId" column="ORDER_ID"
jdbc-type="INTEGER"/>
      <field-descriptor name="typeId" column="TYPE_ID"
jdbc-type="BIGINT"/>
      <field-descriptor name="authCodeId" column="AUTH_CODE_ID"
jdbc-type="BIGINT"/>
      <field-descriptor name="amount" column="AMOUNT"
jdbc-type="DOUBLE" scale="2"/>
      <field-descriptor name="entryDate" column="ENTRY_DATE"
jdbc-type="DATE"
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion"/>
      <field-descriptor name="effectiveDate" column="EFFECTIVE_DATE"
jdbc-type="DATE"
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion"/>
      <field-descriptor name="expirationDate" column="EXPIRATION_DATE"
jdbc-type="DATE"
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion"/>
  </class-descriptor>
------------------------------------------------------------descriptor
end-----------------------------------------------------------------------

 AdjustmentTO objects are only written to the database when the
Collection actually contains any AdjustmentTO objects the first time i
create the order.

 All subsequent attempts to add one more AdjustmentTO object to the
vector and store is not working. When i re-read the OrderTO object i
simply get 
 back the same objects that were created the first time - no more no
less. 

 is this a mapping problem ? 

 Why is that reference descriptor required ? 

thanks 
 

James Nyika
Cambridge Technology Partners
The global eServices company of Novell, Inc.
http://www.novell.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to