initial add of EbeanORM server based on v2.8.1

This commit is contained in:
rbygrave
2012-09-14 00:40:39 +12:00
parent 2b74d0f9d9
commit 96ce4c0ddf
1188 changed files with 135034 additions and 0 deletions
@@ -0,0 +1,43 @@
package com.avaje.tests.autofetch;
import com.avaje.ebean.Ebean;
import com.avaje.ebean.config.GlobalProperties;
import com.avaje.tests.model.basic.Order;
import com.avaje.tests.model.basic.ResetBasicData;
import java.util.List;
public class MainAutoQueryTune1 {
public static void main(String[] args) {
//GlobalProperties.put("ebean.ddl.run", "false");
//GlobalProperties.put("ebean.ddl.generate", "false");
GlobalProperties.put("ebean.autofetch.queryTuning", "true");
// GlobalProperties.put("ebean.autofetch.queryTuningAddVersion", "true");
ResetBasicData.reset();
MainAutoQueryTune1 me = new MainAutoQueryTune1();
me.tuneJoin();
}
private void tuneJoin()
{
List<Order> list = Ebean.find(Order.class)
.setAutofetch(true)
.fetch("customer")
.where()
.eq("status", Order.Status.NEW)
.eq("customer.name", "Rob")
.order().asc("id")
.findList();
for (Order order : list)
{
System.out.println(order.getId() + " " + order.getOrderDate());
}
}
}