QueryFactory qf = Search.getQueryFactory(remoteCache);
// all transactions of account with id 2 which have an amount larger than 1600 or their description contains the word 'rent'
Query q = qf.from(Transaction.class)
.having("accountId").eq(1)
.and(qf.having("amount").gt(1600)
.or().having("description").like("%rent%")).toBuilder().build();
List<Transaction> list = q.list();
assertEquals(2, list.size());
assertEquals("Birthday present", list.get(0).getDescription());