@Test
public void testManyToOneJoinAndFilter() {

    DefaultModelQueryExecutor executor = newExecutor(Book.class);
    QueryOptions options = new QueryOptions();
    assertEquals(2, executor.queryList(options).list.size());
    options.clearResolved();
    options.setJoins("author a");
    options.setFilters("a.name eq 'not exists'");
    assertEquals(0, executor.queryList(options).list.size());
    options.clearResolved();
    options.setFilters("a.name eq 'Author1'");
    List<Record> records = executor.queryList(options).list;
    assertEquals(1, records.size());
    assertEquals("book1", records.get(0).getString("title"));
    options.clearResolved();
    options.setFilters("a.name eq 'Author2'");
    records = executor.queryList(options).list;
    assertEquals(1, records.size());
    assertEquals("book2", records.get(0).getString("title"));
}