我认为您是
Deliverable从
TaskID的顺序中查询前3位。您可以尝试这样的事情:
编辑: 确定,我将再对此刺一击。这应该给你的前3
Deliverable小号下令
Task.id采取只
Deliverable关联到
max(Task.id)
deliverables = (List<Deliverable>) session.createQuery( "from Deliverable as d, Task as t where t.deliverable.id = d.id and t.id = (select max(t1.id) from Task t1 where t1.deliverable.id = d.id) and d.project.id= :id and t.user.username = :name order by t.id desc") .setMaxResults(3) .setLong("id", projectId) .setString("name", username) .list();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)