public class Document extends Model { ... @ManyToMany public Set accessors; ... }
I want to select all Documents which accessors conta
select distinct d from Document d inner join d.accessors a where a.id = :id
You should learn how SQL joins work, and then learn how to use joins in JPQL. That's essential. You'll find plenty of tutorials online. Google is your friend.