This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Load vs Get Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Load vs Get" Watch "Load vs Get" New topic
Author

Load vs Get

Rahul Ba
Ranch Hand

Joined: Oct 01, 2008
Posts: 205
I did not get the difference between load and get method on following point.

Second,load() just returns a proxy by default; the database isn’t hit until the proxy is first invoked. get() hits the database immediately. The load method is useful when you only need a proxy and don’t need to make a database call. You just need a proxy, when in a given session you need to associate an entity before
persisting.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Load vs Get
 
Similar Threads
load() vs get()
POJOs and Legacy Databases
understanding load
How to NOT fetch a collection?
Hibernate return a empty object