I have a named query that returns a Collection of entities.

These entities have a @PreUpdate-annotated method on them. This method is invoked during query.getResultList(). 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.

Why is this? The JPA 2.0 specification does not mention explicitly that @PreUpdate should be called by query execution.

jpa
Edit
Report