Following up a discussion (in Russian) on a developers' forum on advanced querying against many-to-many mapping in JPA I have compiled all my findings in this post. I intentionally leave all object and database names close to the original maybe with minor changes.