hibernate连接查询的过滤问题
比如有两个实体,Person和Food
Person有Long id,String sex和Set<Food> foods三个属性
Food有Long id,Date date和Person属性,其中的date记录吃食物的时间
现在我要查询性别为男的(sex为男)Person的一个List,要求Food的时间为本月
我的hql为select e from Person e left outer join e.foods p with p.planDate between ? and ? where e.sex=?
这个语句查出来的是food在当月的Person,而我的需求是查出来所有的Person,既即使这个Person本月没有food也要列出来
请问应该如何实现