-->
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: problem with updation in one to many relationship
PostPosted: Fri Sep 18, 2009 2:09 am 
Beginner
Beginner

Joined: Mon Sep 14, 2009 9:29 am
Posts: 30
hi all..I have two table namely LoanProposal and BankLoanProposal with relation as

LoanProposal 1---*>BankLoanProposal .I was able to insert successfully and all the select query worked fine with join.But i have problem with updation .. I an newbie ..So please help me..Here are the
hbm file and .cfg file:

BankLoanProposal.hbm.xml:

<hibernate-mapping>
<class name="BankLoanProposal" table="bankloanproposal">
<id name="accountnumber" type="string" >
<generator class="assigned"/>
</id>
<property name="sequencenumber" type="integer"/>
<property name="loanperiod" type="integer"/>
<property name="interestrate" type="long"/>
<property name="interestapplfreq" type="integer"/>
<property name="intcalcmethod" type="integer"/>
<property name="compondfreq" type="integer"/>
<property name="fixedorfloating" type="string"/>
<property name="typeofloan" type="string"/>
<property name="securedunsecured" type="string"/>
<property name="securitytype" type="string"/>
<property name="status" type="string"/>
<property name="createdby" type="string"/>
<property name="createddate" type="date"/>
<property name="authorisedby" type="string"/>
<property name="authoriseddate" type="date"/>
</class>
</hibernate-mapping>


LoanProposal.hbm.xml:

<hibernate-mapping>
<class name="LoanProposal" table="proposals">
<id name="proposalnumber" type="string">
<generator class="assigned">
</generator>
</id>
<property name="bankid" type="integer"/>
<property name="letterreferencenumber" type="string"/>
<property name="dateofsubmission" type="date"/>
<property name="proposedloanamount" type="integer"/>
<property name="stagesofproposal" type="string"/>
<property name="dateofrejection" type="date"/>
<property name="reasonsforrejection" type="string"/>
<property name="loansanctionamount" type="integer"/>
<property name="sanctiondate" type="date"/>
<property name="remarks" type="string"/>
<property name="createdby" type="string"/>
<property name="createddate" type="date"/>
<property name="authorisedby" type="string"/>
<property name="authoriseddate" type="date"/>
<!-- ONE TO MANY MAPPING -->
<list name="bankloanproposal" cascade="all">
<key column="proposalnumber"/>
<list-index column="loanserialno" base="1"></list-index>
<one-to-many class="BankLoanProposal"/>
</list>

<!--MANY TO ONE MAPPING WITH BANKMASTER-->

<many-to-one class="BankMasterPojo" name="bankmasterpojo" column="BANKID" insert="false" update="false">

</many-to-one>
</class>
</hibernate-mapping>


please help me out....


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.