mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
initial add of EbeanORM server based on v2.8.1
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user