SELECT DISTINCT + ORDER BY in JPA 2 Criteria API

后端 未结 2 1793
渐次进展
渐次进展 2021-01-02 03:53

I\'ve a class Lawsuit, that contains a List, each one with a Date attribute.

I need to select all the Law

2条回答
  •  死守一世寂寞
    2021-01-02 04:29

    You can also de-duplicate via group by based on primary key column of root table:

     cq.groupBy(root.get("id")); // Assuming that Lawsuite.id is primary key column
    

提交回复
热议问题