诀窍是使用计数:
select i from Item i join i.tags t
where t in :tags group by i.id having count(i.id) = :tagCount
使用jpql查找具有包含给定集合的所有元素的集合的项目
诀窍是使用计数:
select i from Item i join i.tags t
where t in :tags group by i.id having count(i.id) = :tagCount