Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用日志记录功能,我只希望在数据存储中保留最后 200 条记录。
我怎样才能在 JDOQL 中做到这一点?
如果我使用 SQL,它会像
DELETE FROM MyTable OFFSET 201 ORDER BY myDate DESC,
DELETE FROM MyTable OFFSET 201 ORDER BY myDate DESC
但我很难为JDOQL找到类似的东西。
Query q = pm.newQuery("SELECT FROM mydomain.MyClass ORDER BY myDate DESC RANGE 201"); q.deletePersistentAll()
长得很像我