Hibernate的left join fetch 查询条件问题
当A left join fecth B的时候,怎么对B的条件进行进一步的筛选?
eg:
表VoteGroup:投票组的信息
id,
name
表VoteStatus:用户对该组的投票的状态
id,
VoteGroup.id,外键
UserInfo.id,外键
表UserInfo:用户表
两表已建立映射关系。VoteGroup与VoteStatus一对多,。UserInfo与VoteStatus一对多。
如果只单纯地左连接,hql="from VoteGroupa LEFT JOIN FETCH a.voteStatus order by a.id "没有问题,
但如果加上对VoteStatus的UserInfo.id=1的筛选,怎么个写法?