0

我正在尝试实现一项功能以将 Android 应用程序与服务器同步。

在同步时,android 中的应用程序会登录并显示您上次同步的时间(目前这只是理论)。

问题是,服务器需要选择自报告日期以来发生变化的所有实体,由客户过滤,并将它们(以 json 格式)回答给应用程序;

另一种方法是在每个实体中创建一个列“lastUpdate”。但是,Web 系统已经使用了 Hibernate Envers。实体用 注释@audited

如何使用revinfo表格选择自某个日期以来已更改的所有实体? 记住我不需要实体的历史。只需要知道发生了什么变化。只有最新版本将被发送到安卓应用程序。如何让多次修改的实体在升级过程中只出现一次?

谢谢你。

4

1 回答 1

0

It may be best to keep such application logic separate from the revinfo table, on the principle of Separation of Concern.

Not quite sure about the specifics of your case, but a join table with revision ids and booleans (or dates) is a low cost way of tracking this activity while leaving your Envers audit data in an clean state. After all, your business logic may change and use cases may multiply, but the auditing of changes to your entities is likely to remain the same.

于 2013-08-15T02:39:40.837 回答