title: What's the difference between query.uniqueResult() vs session.load() in Hibernate?
body: <p>Can anyone tell me what's the difference between this code: </p>
  
  <pre><code>// This following method checks if there is an open session
  // and if yes - returns it,  if not - opens a new session. 
  Session session = getSession();
  Query query = session.createQuery("from Entity e where e.id = 1");
  Entity object = (Entity)query.uniqueResult(); 
  </code></pre>
  
  <p>and this: </p>
  
  <pre><code> Session session = getSession();
   Entity object = (Entity)session.load(Entity.class, new Integer(1));
  </code></pre>
  
  <p><br>
  Does the first method return a proxy object? And if I call it again does it hit the database? </p>