title: Hibernate @SelectBeforeUpdate(true) and @DynamicUpdate(true) not working with session.merge
body: <p>I'm using Hibernate 4.1.7.Final and trying to update an object using the <code>session.merge(entity)</code> method. The entity is annotated with:</p>
  
  <p><code>@SelectBeforeUpdate(true)</code> and <code>@DynamicUpdate(true)</code></p>
  
  <p>However, I'm finding that the merge method overwrites original non-null fields (in the previously persisted entity) with null values from entity being merged - which I don't want. I thought <code>@DynamicUpdate</code> would only update non-null values.</p>
  
  <p>The description of the merge method in the Hibernate docs is:</p>
  
  <blockquote>
    <p>Copy the state of the given object onto the persistent object with the
    same identifier. If there is no persistent instance currently
    associated with the session, it will be loaded. Return the persistent
    instance. If the given instance is unsaved, save a copy of and return
    it as a newly persistent instance. The given instance does not become
    associated with the session. This operation cascades to associated
    instances if the association is mapped with cascade="merge"</p>
  </blockquote>
  
  <p>Any ideas what's wrong?</p>
  
  <p>Thanks.</p>