Вот упрощенные классы:
Код: Выделить всё
@Entity
class Item {
@ManyToMany
var tags: java.util.Set[Tag] = new java.util.HashSet[Tag]()
}
@Entity
class Tag {
@ManyToMany(mappedBy="tags")
var items: java.util.Set[Item] = new java.util.HashSet[Item]
}
Код: Выделить всё
select distinct i
from Item i join i.tags t
where t in (:tags)
Код: Выделить всё
select distinct i
from Item i join i.tags t
where (:tags) in t
Как я могу выразить это в JPQL?
Подробнее здесь: https://stackoverflow.com/questions/143 ... -with-jpql