Commit 761e3251 authored by o2sword's avatar o2sword Committed by o2null
Browse files

登录后返回的ws消息改为最新10条

(cherry picked from commit 5094af4d)
No related merge requests found
Showing with 2 additions and 2 deletions
+2 -2
......@@ -102,8 +102,8 @@ public class ActionCollaboration {
Predicate p = cb.equal(root.get(Message_.person), effectivePerson.getDistinguishedName());
p = cb.and(p, cb.equal(root.get(Message_.consumer), MessageConnector.CONSUME_WS));
p = cb.and(p, cb.equal(root.get(Message_.consumed), false));
cq.select(root).where(p).orderBy(cb.asc(root.get(Message_.createTime)));
os = em.createQuery(cq).setMaxResults(100).getResultList();
cq.select(root).where(p).orderBy(cb.desc(root.get(Message_.createTime)));
os = em.createQuery(cq).setMaxResults(10).getResultList();
emc.beginTransaction(Message.class);
for (Message o : os) {
o.setConsumed(true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment