-->
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 collections and lazy mode
PostPosted: Wed Oct 10, 2007 4:55 am 
Newbie

Joined: Wed Oct 10, 2007 4:18 am
Posts: 1
Hibernate version:3.1.3
Name and version of the database you are using:Oracle 10g

I use a one-to-many association and I have got problem with lazy mode because the collection is loaded when I search for parents items. When I look for SQL queries, there is one query for parents and one for each result. I don't want to use fetch mode, I don't want the collection to be loaded.
When I look in source code, there is a "some collections are not lazy" in CollectionType class. Am I in this case ?

Thanks for help.

Here is my parent class mapping file :

<class name="Archive" table="T_ARCHIVE" mutable="true" dynamic-update="false" dynamic-insert="false" select-before-update="false" abstract="false">
...
<bag name="events" lazy="true">
<key on-delete="noaction" unique="false" not-null="true">
<column name="ARC_ID_ARCHIVE" sql-type="NUMBER(10)" not-null="true" length="10"/>
</key>
<one-to-many class="com.archive.model.ArchiveEvent"/>
</bag>


Her is my child class mapping file :

<class name="ArchiveEvent" table="T_ARCHIVE_EVENT" mutable="true" dynamic-update="false" dynamic-insert="false" select-before-update="false" abstract="false">
...
<many-to-one name="archive" class="com.archive.model.Archive" outer-join="false" update="false" insert="false">
<column name="ARC_ID_ARCHIVE" sql-type="NUMBER(10)" not-null="true" length="10"/>
</many-to-one>


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.