hibernate级联join fetch查询记录数比正常要多的问题

来源:互联网 发布:淘宝重新拆分订单 编辑:程序博客网 时间:2024/05/16 09:19

String hql="select distinct cts from CommunicationType cts inner join fetch cts.collectionPoints  order by cts.id";

问题前没有select distinct cts   查询的记录数要CommunicationType要数据库记录数多,加上后查询的结果就正常了 

原创粉丝点击