-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Deleting Child object
PostPosted: Fri Apr 11, 2008 1:31 pm 
Newbie

Joined: Sun Oct 28, 2007 9:33 pm
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.2.5

Name and version of the database you are using:Oracle9i

Mapping file:


<class name="com.uprr.app.cbs.common.ibill.IndustryBill" table="CBS_IND_BILL" schema="CBS" >

<id name="industryBillId" type="java.lang.Long">
<column name="IND_BILL_ID" precision="9" scale="0" />
<generator class="sequence">
<param name="sequence">cbs_ind_bill_q1</param>
</generator>
</id>

<property name="acctId" type="java.lang.Long">
<column name="ACCT_ID" precision="9" scale="0" not-null="true" />
</property>

<property name="incdDt" type="java.util.Date">
<column name="INCD_DT" length="7" not-null="true" />
</property>

<property name="carmHrsCnt" type="big_decimal">
<column name="CARM_HRS_CNT" precision="6" scale="0" />
</property>

<property name="crmnChrgAmt" type="big_decimal">
<column name="CRMN_CHRG_AMT" precision="9" />
</property>

<bag name="damagedEqmtList" inverse="true" cascade="all" lazy="false">
<key>
<column name="IND_BILL_ID" precision="9" scale="0" not-null="true" />
</key>
<one-to-many class="com.uprr.app.cbs.common.ibill.DamagedEqmt" />
</bag>
</class>


<class name="com.uprr.app.cbs.common.ibill.DamagedEqmt" table="CBS_IND_BI_DAMG_EQMT" schema="CBS" optimistic-lock="version">

<id name="damagedEqmtId" type="java.lang.Long">
<column name="IND_BI_DAMG_EQMT_ID" precision="9" scale="0" />
<generator class="sequence" >
<param name="sequence">CBS_IND_BI_DAMG_EQMT_Q1</param>
</generator>
</id>

<many-to-one name="industryBill" class="com.uprr.app.cbs.common.ibill.IndustryBill" >
<column name="IND_BILL_ID" precision="9" scale="0" not-null="true" />
</many-to-one>

<property name="lineItemType" type="java.lang.String">
<column name="LINE_ITEM_TYPE" length="1" not-null="true" />
</property>

<property name="eqmtInit" type="java.lang.String">
<column name="EQMT_INIT" length="4" not-null="true" />
</property>

<property name="versionNumber" type="java.lang.Long">
<column name="VRSN_NBR" precision="3" scale="0" not-null="true" />
</property>

<bag name="repairRecords" fetch="select" inverse="true" cascade="all,delete-orphan" lazy="false" >
<key>
<column name="IND_BI_DAMG_EQMT_ID" precision="9" scale="0" not-null="true" />
</key>
<one-to-many entity-name="CBSRepairRecords" />
</bag>
</class>

<class name="com.uprr.app.cbs.common.ibill.RepairRecords"
table="CBS_IND_BI_REPR_DTL" schema="CBS"
entity-name="CBSRepairRecords" optimistic-lock="version">
<id name="repairRecId" type="long"
column="IND_BI_REPR_DTL_ID">
<generator class="sequence">
<param name="sequence">
cbs_ind_bi_repr_dtl_q1
</param>
</generator>
</id>
<property name="eqmtInit" type="string">
<column name="EQMT_INIT" length="4" />
</property>
<property name="eqmtNbr" type="integer">
<column name="EQMT_NBR" />
</property>
<property name="reprDate" type="date">
<column name="REPR_DT" length="10" />
</property>
<property name="reprDesc" type="string">
<column name="REPR_DESC" />
</property>
<property name="qty" type="integer">
<column name="REPR_QTY" />
</property>
<many-to-one name="damgedEqmt"
class="com.uprr.app.cbs.common.ibill.DamagedEqmt" not-null="true" fetch="join" column="IND_BI_DAMG_EQMT_ID" />
</class>


What exactly I am missing here..in order to do the following..

1. When I remove RepairRecords list from DamagedEqmt
2. I do saveOrUpdate operation
3. But RepairRecords are removed from DamagedEqmt in database.

How can I do that


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.