Search in sources :

Example 1 with Issue1163Master

use of org.nutz.dao.test.meta.issue1163.Issue1163Master in project nutz by nutzam.

the class SimpleDaoTest method test_issue_1163.

@Test
public void test_issue_1163() {
    dao.create(Issue1163Master.class, true);
    dao.create(Issue1163Pet.class, true);
    ArrayList<Issue1163Pet> pets = new ArrayList<Issue1163Pet>();
    for (int i = 0; i < 3; i++) {
        Issue1163Pet pet = new Issue1163Pet();
        pet.setName("i" + i);
        pets.add(pet);
    }
    Issue1163Pet gpet = new Issue1163Pet();
    gpet.setName("zozoh");
    Issue1163Master master = new Issue1163Master();
    master.setName("wendal");
    master.setPets(pets);
    master.setGpet(gpet);
    dao.insertWith(master, null);
}
Also used : Issue1163Pet(org.nutz.dao.test.meta.issue1163.Issue1163Pet) ArrayList(java.util.ArrayList) Issue1163Master(org.nutz.dao.test.meta.issue1163.Issue1163Master) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 Issue1163Master (org.nutz.dao.test.meta.issue1163.Issue1163Master)1 Issue1163Pet (org.nutz.dao.test.meta.issue1163.Issue1163Pet)1