Hibernate Envers - Doesn't write audit records for createQuery(…).executeUpdate(), only .persist() and .merge()

后端 未结 3 1317
灰色年华
灰色年华 2021-01-19 09:04

I have 3 ways things get written to the DB

public void create(T object) {
    entityManager.persist(object);
}

public void update(T object) {
    object = e         


        
3条回答
  •  鱼传尺愫
    2021-01-19 09:36

    No, Envers won't work if you are using executeUpdate. That is because the update doesn't pass through Hibernate's event mechanism, so Envers has no chances of intercepting the change, and writing the audit.

提交回复
热议问题