Get previous version of entity in Hibernate Envers

后端 未结 5 1741
孤街浪徒
孤街浪徒 2021-01-31 22:36

I have an entity loaded by Hibernate (via EntityManager):

User u = em.load(User.class, id)

This class is audited by Hibernate Enve

5条回答
  •  鱼传尺愫
    2021-01-31 23:22

    From the docs:

    AuditReader reader = AuditReaderFactory.get(entityManager);
    User user_rev1 = reader.find(User.class, user.getId(), 1);
    

提交回复
热议问题