mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Remove unused ServerConfig debugSql options, Update Tests to use agentloader
This commit is contained in:
@@ -3,38 +3,36 @@ package com.avaje.tests.query;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.Query;
|
||||
import com.avaje.tests.model.basic.Customer;
|
||||
import com.avaje.tests.model.basic.OrderShipment;
|
||||
import com.avaje.tests.model.basic.ResetBasicData;
|
||||
|
||||
public class TestJoinQuery extends TestCase {
|
||||
|
||||
public void test() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
// test that join to order.details is not included
|
||||
Query<Customer> query = Ebean.find(Customer.class)
|
||||
.setAutofetch(false)
|
||||
.fetch("orders")
|
||||
.fetch("orders.details");
|
||||
|
||||
List<Customer> list = query.findList();
|
||||
Assert.assertTrue("has rows", list.size() > 0);
|
||||
|
||||
// test that join to order.details is not included
|
||||
Query<OrderShipment> shipQuery = Ebean.find(OrderShipment.class)
|
||||
.setAutofetch(false)
|
||||
.fetch("order")
|
||||
.fetch("order.details");
|
||||
|
||||
|
||||
List<OrderShipment> shipList = shipQuery.findList();
|
||||
Assert.assertTrue("has rows", shipList.size() > 0);
|
||||
}
|
||||
|
||||
public class TestJoinQuery extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
// test that join to order.details is not included
|
||||
Query<Customer> query = Ebean.find(Customer.class).setAutofetch(false).fetch("orders")
|
||||
.fetch("orders.details");
|
||||
|
||||
List<Customer> list = query.findList();
|
||||
Assert.assertTrue("has rows", list.size() > 0);
|
||||
|
||||
// test that join to order.details is not included
|
||||
Query<OrderShipment> shipQuery = Ebean.find(OrderShipment.class).setAutofetch(false)
|
||||
.fetch("order").fetch("order.details");
|
||||
|
||||
List<OrderShipment> shipList = shipQuery.findList();
|
||||
Assert.assertTrue("has rows", shipList.size() > 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user