title: Hibernate execute update with criteria
body: <p>Is it possible to execute an update while using <code>Criteria</code> in <code>Hibernate</code>? For example:</p>
  
  <pre><code>Session session = getSession();
  Criteria crit = session.createCriteria(User.class);
  crit.add(Restrictions.eq("token", sessionToken));
  
  User user= new User();
  Transaction tx = session.getTransaction();
  try 
  {
      tx.begin();
      session.updateWithCriteria(user, crit); //my imaginary function 
      tx.commit();
  }
  catch (Exception e) 
  {
      e.printStackTrace();
      tx.rollback();
  }
  
  session.close();
  </code></pre>