title: Does Hibernate update an entity that has not changed?
body: <p>Given an unchanged entity, does <a href="http://www.hibernate.org/" rel="noreferrer">Hibernate</a> <a href="http://docs.jboss.org/hibernate/core/3.5/javadocs/org/hibernate/Session.html#update%28java.lang.Object%29" rel="noreferrer"><code>session.update(entity)</code></a> send an <a href="http://en.wikipedia.org/wiki/SQL" rel="noreferrer">SQL</a> <a href="http://www.w3schools.com/sql/sql_update.asp" rel="noreferrer"><code>UPDATE</code></a> statement to the database server?</p>
  
  <p>For example, in the following code, does Hibernate send an SQL <code>UPDATE</code> to the database server?</p>
  
  <pre><code>Session session = factory.openSession();
  Person me = new Person(null, "Derek Mahar");
  session.save(me);
  Person me2 = new Person(me.getId(), "Derek Mahar");
  session.update(me2);
  session.flush();
  </code></pre>