Hi 

 I just wanted to reping the group on this questions

 I am having trouble performing tasks with a 1-M mapping

 None of my objects use the reference descritor constructs. I
constructed my 1-M exactly as the documentation 
suggests but the problem that i have is that  when my test attempts to
add a new child object (adjustmentTO) to the order (orderTO)
it does not work.

 i basically read the orderTO from the database, add a new AdjustmentTO
object to the adjustments collection and try to store. It does not
store
 the adjustment despite having auto-update set to true. 

 However, if i call store on both the order and the adjustment, then
the order is updated and the adjustment is created. is this how it is
supposed to function
 or am i missing something ?

 thanks

J

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

>>> [EMAIL PROTECTED] 5/31/2003 3:23:19 PM >>>
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] 


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

Reply via email to