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!