Hibernate Envers - 获取已更改的字段 [英] Hibernate Envers - Get Fields that have changed
问题描述
我现在想在用户界面上显示一些审计信息。对象/表格变得非常复杂,所以我正在寻找一种方法来查看审核中哪些字段发生了变化。目前 Envers
存储每个标有修订标识的对象的快照。我可以查看每个对象的修订版本,然后手动查询以查看发生了什么变化,但是我想知道是否有方法可以获取 Envers
来存储哪些字段已更改。这可能吗?我发现自2011年起这个链接,它建议手动检查每个对象字段。我关心的是速度。我有很多相关的对象,我可能只有一个更新的字段。我将不得不查询很多字段来查找已更改的字段。
是否可以存储已更改的字段?
谢谢
编辑
说我正在使用REVCHANGES表,所以我可以看到什么改变了什么样的修订,但这只是在实体级而不是字段级
>在更新的Envers版本中,您可以使用布尔标志跟踪每个修订版更改哪些属性。请参阅:I have a rather complicated DB structure that I am trying to audit. Currently I have Envers running and it audits the changes that are made to each object. This works really well!
I now want to show some audit information on the UI. The objects/tables get quite complicated so I was looking for a way to see what fields have changed in the audit. Currently Envers
stores a snapshot of each object stamped with a revision id. I can look at each object's revision and then manually query to see what has changed but I was wondering if there was a way I can get Envers
to store which fields have changed. Is this possible? I found this link from 2011 and it recommends checking each object field manually. My concern here is speed. I have lots of objects related and I may only have one updated field. I will have to query a lot of fields to find the one that has changed.
Is it possible to store the fields that have changed?
Thanks
EDIT
I should have said that I am using the REVCHANGES table so I can see what has changed at what revisions but again this is only at entity level not field level
In newer Envers versions you can track which properties changed at each revision using a boolean flag. See:
这篇关于Hibernate Envers - 获取已更改的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!