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:
@@ -2,43 +2,42 @@ package com.avaje.tests.batchload;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.FetchConfig;
|
||||
import com.avaje.tests.model.basic.Contact;
|
||||
import com.avaje.tests.model.basic.Customer;
|
||||
import com.avaje.tests.model.basic.ResetBasicData;
|
||||
|
||||
public class TestLazyLoadEmptyCollection extends TestCase {
|
||||
public class TestLazyLoadEmptyCollection extends BaseTestCase {
|
||||
|
||||
public void test() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
Customer c = new Customer();
|
||||
c.setName("lazytest");
|
||||
|
||||
Contact con = new Contact("jim", "slim");
|
||||
c.addContact(con);
|
||||
|
||||
Ebean.save(c);
|
||||
|
||||
List<Customer> list = Ebean.find(Customer.class)
|
||||
.fetch("contacts", new FetchConfig().query(0))
|
||||
.fetch("contacts.notes", new FetchConfig().query(100))
|
||||
.findList();
|
||||
|
||||
for (Customer customer : list) {
|
||||
List<Contact> contacts = customer.getContacts();
|
||||
for (Contact contact : contacts) {
|
||||
contact.getNotes();
|
||||
}
|
||||
System.out.println(customer);
|
||||
System.out.println(contacts);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
Customer c = new Customer();
|
||||
c.setName("lazytest");
|
||||
|
||||
Contact con = new Contact("jim", "slim");
|
||||
c.addContact(con);
|
||||
|
||||
Ebean.save(c);
|
||||
|
||||
List<Customer> list = Ebean.find(Customer.class).fetch("contacts", new FetchConfig().query(0))
|
||||
.fetch("contacts.notes", new FetchConfig().query(100)).findList();
|
||||
|
||||
for (Customer customer : list) {
|
||||
List<Contact> contacts = customer.getContacts();
|
||||
for (Contact contact : contacts) {
|
||||
contact.getNotes();
|
||||
}
|
||||
System.out.println(customer);
|
||||
System.out.println(contacts);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user