-->
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: SELECT statements issued when item w/collection is udated...
PostPosted: Sat Feb 14, 2009 2:15 pm 
Beginner
Beginner

Joined: Wed Dec 10, 2008 5:59 am
Posts: 47
Hi,

I have a class Track which has the followig collections

- Shares
- Agreements
- Keywords
- Files

Every time i update a given Track instance through the update() method,
Hibernate issues a series of SELECT statements (which, as far as i can see, purpose is to update the collections). Is Hibernate updating the collections every time i update a given track in the database (that is, synchronizing the instance with the database?)?

My mapping file is as follows:

Code:
<hibernate-mapping>
  <class name="com.tracker.db.entities.Track" table="track">
    <id column="id" length="36" name="id" type="com.tracker.db.usertypes.CustomUUID"/>

[...properties...]

    <!-- Agreements -->
    <set cascade="all, delete-orphan" lazy="false" name="agreementRelationships" sort="natural">
      <key column="track_id" not-null="true"/>
      <one-to-many class="com.tracker.db.entities.AgreementRelationship"/>
    </set>
    <!-- Keywords -->
    <set cascade="all, delete-orphan" lazy="false" name="keywordRelationships" sort="natural">
      <key column="track_id" not-null="true"/>
      <one-to-many class="com.tracker.db.entities.KeywordRelationship"/>
    </set>
    <!-- Shares -->
    <set cascade="all, delete-orphan" lazy="false" name="shares" sort="natural">
      <key column="track_id" not-null="true"/>
      <one-to-many class="com.tracker.db.entities.Share"/>
    </set>
    <!-- Files -->
    <set cascade="all" lazy="false" name="files">
      <key column="track_id" not-null="true"/>
      <one-to-many class="com.tracker.db.entities.File"/>
    </set>
  </class>
</hibernate-mapping>


Please note that i need to set all collections to lazy="false", as the application is 100% dependent on accessing all collections in order to populate a JTable which gives a full overview of all tracks (in a given track selection).

Any advise would be very much appreciated!


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.