• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Load vs Get

 
Rahul Ba
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic