Refactor internals of batch lazy loading and query fetches

This commit is contained in:
Rob Bygrave
2014-01-18 23:35:42 +13:00
parent e685e2f4ac
commit 05dcdf162b
28 changed files with 661 additions and 981 deletions
@@ -19,19 +19,27 @@ public class TestQueryFetchJoinWithOrder extends BaseTestCase {
ResetBasicData.reset();
List<Order> list = Ebean.find(Order.class).fetch("details", new FetchConfig().query()).order()
.asc("id").order().desc("details.id").findList();
List<Order> list = Ebean.find(Order.class)
.fetch("details", new FetchConfig().query())
.order().asc("id")
.order().desc("details.id").findList();
Assert.assertNotNull(list);
List<Order> list2 = Ebean.find(Order.class).fetch("customer", new FetchConfig().query())
.fetch("customer.contacts").order().asc("id").order().asc("customer.contacts.lastName")
List<Order> list2 = Ebean.find(Order.class)
.fetch("customer", new FetchConfig().query(5))
.fetch("customer.contacts")
.order().asc("id")
.order().asc("customer.contacts.lastName")
.findList();
Assert.assertNotNull(list2);
List<Customer> list3 = Ebean.find(Customer.class).fetch("orders").filterMany("orders")
.eq("status", Order.Status.NEW).order().desc("orders.id").findList();
List<Customer> list3 = Ebean.find(Customer.class)
.fetch("orders")
.filterMany("orders").eq("status", Order.Status.NEW)
.order().desc("orders.id")
.findList();
Assert.assertNotNull(list3);