anchor.diff:        {
           final long entityStartAt = System.currentTimeMillis();
           log( mappingSourceCode, "Synchronizing <%= entity.qualified_name %> adds and updates" );
  -<% if entity.sync.update_via_sync? -%>
           synchronize<%= entity.data_module.name %><%= entity.name %>Updates( mappingSourceCode, recorder );
  -<% end -%>
           mark<%= entity.data_module.name %><%= entity.name %>RemovalsPreSync( mappingSourceCode, recorder );
           final int addCount = recorder.getMetricValue( "<%= entity.data_module.name %>.<%= entity.name %>.AddCount" ).get();
           log( mappingSourceCode, "Added " + addCount + " <%= entity.data_module.name %>.<%= entity.name %> instances" );
  
positive.code:         }
          else
          {
            _entityManager.
              createNativeQuery( "<%= j_escape_string("UPDATE #{ entity.sync.master_entity.sql.qualified_table_name } SET #{ data_module.sql.dialect.quote('MasterSynchronized') } = ? WHERE #{ data_module.sql.dialect.quote('MappingID') } = ? AND #{ data_module.sql.dialect.quote('MappingSource') } = ?") %>" ).
              setParameter( 1, true ).
  
negative.code:             setParameter( 3, mappingSourceCode ).
              executeUpdate();
            recorder.incMetric( "<%= entity.data_module.name %>.<%= entity.name %>.UpdateCount", 1 );
  <% else -%>
            throw new java.lang.IllegalStateException( "Attempted to update <%= entity.qualified_name %> entity that has no mutable fields" );
  <% end -%>
          }
          _entityManager.flush();
          _entityManager.getEntityManagerFactory().getCache().evictAll();
  