-->
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.  [ 3 posts ] 
Author Message
 Post subject: Get<>() vs. Load<>() ?
PostPosted: Mon Jun 26, 2006 2:59 pm 
Newbie

Joined: Wed Jun 21, 2006 2:45 pm
Posts: 16
Hibernate version:
Alpha Generics version

Could someone explain the fundamental difference of using Get vs. Load ?

(or point me to where to find this?)

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 3:35 pm 
Pro
Pro

Joined: Fri Nov 19, 2004 5:52 pm
Posts: 232
Location: Chicago, IL
Get() will return null if the object with the given identifier doesn't exist and Load() with throw an exception. Other than that, I think they're basically the same.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 9:38 pm 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
jemiller is 100% correct.

I just dug into the code. There's the only line of code thats been added to Load that isn't in Get:

Code:
ObjectNotFoundException.ThrowIfNull( result, id, clazz );


And, that doesn't seem to apply to the Load(object obj, object id) method. It does apply to the Load(Type type, object id) and, by proxy, all of the generics.


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