-->
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.  [ 2 posts ] 
Author Message
 Post subject: session.load and session.get
PostPosted: Wed Jul 20, 2005 1:29 pm 
Newbie

Joined: Thu Jul 14, 2005 7:54 pm
Posts: 11
I am trying a simple retrieve by id query using session.load() I always get back an object with every member set to null, while session.get() returns correct object. any idea?

Hibernate version:3.05


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 20, 2005 2:42 pm 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
With get Hibernate hits the DB imediately and selects the value by primary key.

With load Hinbernate creates a proxy, the DB is hit as soon you require the value of a property. You can switch this off by setting lazy="false" in the class tag of you hbm.xml file.

See also the Javadoc of the two methods.

HTH
Ernst


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.