-->
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: issue with Collection mapping
PostPosted: Sun Aug 16, 2009 10:59 pm 
Newbie

Joined: Sun Feb 18, 2007 1:05 pm
Posts: 16
Hi,
I have a parent object Institute which have a collection of classes inside it.
My mappings are
Code:
<subclass name="com.scientia.dms.commons.vo.EccInstitute" discriminator-value="EC">
         <set name="empSet" cascade="all-delete-orphan" >
            <key column="INSTITUTE_ID"  />
            <one-to-many class="com.scientia.dms.commons.vo.EccInstiEmployee" />
         </set>
         <set name="classSet" cascade="all" order-by="CLASS_ID" >
            <key column="INSTITUTE_ID" />
            <one-to-many class="com.scientia.dms.commons.vo.InstituteClass" />
         </set>
         
         
      </subclass>   



We can consider InstituteClas which is defined as a Set inside the EccInstitute class. While I am saving the object of EccInstitute i can see the following queries
Code:
Hibernate: update dms_institute set HEAD=?, INSTITUTE_NAME=?, INSTI_TYPE=?, ADDRESS=?, PHONE_NO=?, EMAIL_ID=?, LOCATION=?, fax=?, PARISH_ID=? where INSTITUTE_ID=?

Hibernate: update dms_insti_class set INSTITUTE_ID=?, TUTOR=?, CLASS_NAME=?, MALE=?, FEMALE=?, CHRISTIAN=?, HINDU=?, MUSLIM=?, SC_ST=?, STRENGTH=? where CLASS_ID=?
Hibernate: update dms_insti_class set INSTITUTE_ID=?, TUTOR=?, CLASS_NAME=?, MALE=?, FEMALE=?, CHRISTIAN=?, HINDU=?, MUSLIM=?, SC_ST=?, STRENGTH=? where CLASS_ID=?
Hibernate: update dms_insti_class set INSTITUTE_ID=?, TUTOR=?, CLASS_NAME=?, MALE=?, FEMALE=?, CHRISTIAN=?, HINDU=?, MUSLIM=?, SC_ST=?, STRENGTH=? where CLASS_ID=?
Hibernate: update dms_insti_class set INSTITUTE_ID=?, TUTOR=?, CLASS_NAME=?, MALE=?, FEMALE=?, CHRISTIAN=?, HINDU=?, MUSLIM=?, SC_ST=?, STRENGTH=? where CLASS_ID=?

There are 4 classes inside the institute.These 4 additional queries (update for the classes) being fired irrespective of whether the objects are modified or not.How can I prevent this queries being fired,in the case the classes are not modified.

Thanks in advance

Shaiju


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.