How to express a query with JPA 2.0 Criteria that should fetch all entities A that are not in relation (m:n) with an Entity B.
Domain Model:
@Entity class A{
@Id int id;
@ManyToMany List<B> disableForB;
}
@Entity class B{
@Id int id;
}
The problem related to this domain model is: How to find all A
that are not in relation disableForB
for an specific B
?