-->
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.  [ 4 posts ] 
Author Message
 Post subject: how to get rid off lazy loading in hibernate.
PostPosted: Thu Jan 18, 2007 9:31 am 
Beginner
Beginner

Joined: Mon Oct 30, 2006 12:46 am
Posts: 26
Hi all,

By default, hibernate allows lazy loading, which is not good when we are getting the from two tables which are associted.So now i want to remove the lazy loading.

I have mentioned lazy="false" in <class> tag for assiocted class(table).

Is that enough to avoid lazy loading ?

Pls hepl me !!

Thanks
Praveen.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 10:28 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
no. that only lazily loads the properties.

add lazy="false" under the collection tags like

<map

lazy="false"

/>

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 10:41 am 
Beginner
Beginner

Joined: Mon Oct 30, 2006 12:46 am
Posts: 26
hi
could you explain detail as i am newbee to hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 11:38 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
you need to ad that property under the association tags. like

Code:

<list
        name="child"
        cascade="all-delete-orphan"
        lazy="false"
        inverse="true"

    >
   
        <key>
            <column name="somekey" />
           
        </key>
       
   
        <one-to-many
            class="related.class.Class"
        />
    </list>

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

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.