English 中文(简体)
将更新发布到“a”墙上
原标题:Posting updates to "a" wall

我有一个类似facebook的应用程序——一个虚拟白板,用于多个团队,他们共享该项目的公共墙。我为大约9-12个实体捕获数据。我正在尝试让用户的主页显示自上次登录以来发生的活动的更新,比如facebook如何发布通知:

“[USER]在20分钟前对[某个实体]进行了[某些活动]”

其中[…]是可点击的链接,活动主要是(而不仅仅是)CRUD。

我必须坚持这些更新。我使用MySQL作为后端数据库,并考虑为每个项目提供一个更新表来存储活动。但似乎每个表需要一个触发器,这是多余的。更重要的是,由于存在许多不同的实体,因此很难确定更新表的表格模式。

限制是使用MySQL,但我对“如何”实现这一功能的其他选项持开放态度。

有什么想法吗?

PS:使用jQuery+REST+Restlet+Glassfish+MySQL+Java

最佳回答

它不必在数据库级别进行处理。您可以在每次操作中调用一个事务日志记录服务。每个事务都得到一个(唯一的、连续的)密钥。

存储此人看到的最后一个项目的密钥,并显示密钥较高的任何更新,即更新最后一个看到的密钥。

周期性例程可以遍历用户帐户,并查看所有用户中看到的最低事务日志关键字是什么(即,所有用户已经看到的最新日志条目是什么),并删除/归档具有关键字<那个。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签