title: Why does a JPA @PreUpdate-annotated method get called during a query?
body: <p>I have a named query that returns a <code>Collection</code> of entities.</p>
  
  <p>These entities have a <code>@PreUpdate</code>-annotated method on them.  This method is invoked during <code>query.getResultList()</code>.  Because of this, the entity is changed within the persistence context, which means that upon transaction commit, the entity is written back to the database.</p>
  
  <p>Why is this?  The JPA 2.0 specification does not mention explicitly that <code>@PreUpdate</code> should be called by query execution.</p>