title: Does an EJB-QL UPDATE statement defeat CMP
body: <p>Does running an EJBQL UPDATE statement defeat the performance benefits of container managed persistance when compared to modifing the accessors on a managed entity?</p>
  
  <p>I'm interested in this specifically for a database load / performance perspective.</p>
  
  <p>For example, if I have an entity called MyEntity and I want to update myField1 and myField2 is there a performance difference between the two following methods:</p>
  
  <pre><code>Query query = em.createQuery("UPDATE MyEntity m SET m.myField1 = :value1, m.myField2 = :value2 WHERE m.id = :id")
  query.executeUpdate();
  </code></pre>
  
  <p>versus</p>
  
  <pre><code>MyEntity myEntity = find("123");
  
  myEntity.setMyField1("newvalue");
  myEnttiy.setMyField2("newvalue2");
  </code></pre>