Search in sources :

Example 21 with Pet

use of test.po.Pet in project eweb4j-framework by laiweiwei.

the class TestInsertSql method prepare.

@BeforeClass
public static void prepare() throws Exception {
    String err = EWeb4JConfig.start("start.eweb.xml");
    if (err != null) {
        System.out.println(">>>EWeb4J Start Error --> " + err);
        System.exit(-1);
    }
    pet = new Pet();
    insert = SqlFactory.getInsertSql(pet);
}
Also used : Pet(test.po.Pet) BeforeClass(org.junit.BeforeClass)

Example 22 with Pet

use of test.po.Pet in project eweb4j-framework by laiweiwei.

the class TestSelectSql method prepare.

@BeforeClass
public static void prepare() throws Exception {
    String err = EWeb4JConfig.start("start.eweb.xml");
    if (err != null) {
        System.out.println(">>>EWeb4J Start Error --> " + err);
        System.exit(-1);
    }
    pet = new Pet();
    master = new Master();
    master.setId(5L);
    pet.setMaster(master);
    pet.setName("xiaobai");
    select = SqlFactory.getSelectSql(pet, "mysql");
    fieldAdd = "+0";
}
Also used : Master(test.po.Master) Pet(test.po.Pet) BeforeClass(org.junit.BeforeClass)

Example 23 with Pet

use of test.po.Pet in project eweb4j-framework by laiweiwei.

the class TestUpdateSql method prepare.

@BeforeClass
public static void prepare() throws Exception {
    String err = EWeb4JConfig.start("start.eweb.xml");
    if (err != null) {
        System.out.println(">>>EWeb4J Start Error --> " + err);
        System.exit(-1);
    }
    pet = new Pet();
    update = SqlFactory.getUpdateSql(pet);
}
Also used : Pet(test.po.Pet) BeforeClass(org.junit.BeforeClass)

Example 24 with Pet

use of test.po.Pet in project eweb4j-framework by laiweiwei.

the class CascadeTest method testOneRel.

@Test
public void testOneRel() throws Exception {
    Master master = new Master();
    master.setId(1L);
    master.getPets().add(new Pet());
    master.getPets().add(new Pet());
    master.getPets().add(new Pet());
    //DAOFactory.getCascadeDAO().insert(master, "pets");
    Assert.assertEquals(true, true);
}
Also used : Master(test.po.Master) Pet(test.po.Pet) Test(org.junit.Test)

Example 25 with Pet

use of test.po.Pet in project eweb4j-framework by laiweiwei.

the class TestCascadeDAO method testOneSelect.

public static void testOneSelect() {
    List<Pet> petList;
    try {
        petList = DAOFactory.getSelectDAO().selectAll(Pet.class);
        if (petList != null) {
            for (Pet p : petList) {
                System.out.println(p + "|" + p.getMaster());
                DAOFactory.getCascadeDAO().select(p, "master");
                System.out.println(p.getMaster());
            // break;
            }
        }
    } catch (DAOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : DAOException(org.eweb4j.orm.dao.DAOException) Pet(test.po.Pet)

Aggregations

Pet (test.po.Pet)27 Master (test.po.Master)8 BeforeClass (org.junit.BeforeClass)4 Test (org.junit.Test)4 HashMap (java.util.HashMap)3 DAOException (org.eweb4j.orm.dao.DAOException)3 Sql (org.eweb4j.orm.sql.Sql)3 DAO (org.eweb4j.orm.dao.DAO)2 Map (java.util.Map)1 EntityManager (javax.persistence.EntityManager)1 EntityManagerFactory (javax.persistence.EntityManagerFactory)1 Trans (org.eweb4j.orm.jdbc.transaction.Trans)1