With PlayFramework I'm trying to list all the items where there is no ManyToMany items associated with my model, how can I do that ?
Here's my structure :
User
@ManyToMany
List<Section> sections;
public static Model.Finder<Long,User> find = new Model.Finder<Long, User>(Long.class, User.class);
Section
Integer year;
@ManyToMany
List<User> users;
public static Model.Finder<Long,Section> find = new Model.Finder<Long, Section>(Long.class, Section.class);
You need to do this:
String q="find * fetch sections where sections.id is null"
Ebean.createQuery(User.class,q).findList();
This will create a left outer join query, the find.where().IsNull("sections") doesn't work.