Given these two entities in a database accessed through Hibernate JPA,

```
@Entity class A {
   int id;
   String aName;
}

@Entity class B {
   int id;
   String bName;
   @ManyToMany Set<A> aRefs;
}

```

the result I want is the collection of the `aName`s of all A entities that are *not* referred to by B entities. Or in other words, all `A`s which are not part of any `B`'s `aRefs`.

I've tried a number of alternatives using `NOT EXISTS` and `NOT MEMBER OF` with subselects and even dabbled with `LEFT OUTER JOIN`s, but annoyingly enough the queries I come up with either get rejected by Hibernate's interpreter or even end up translated to invalid SQL that's rejected by Oracle.