use of test.po.Pet in project eweb4j-framework by laiweiwei.
the class TestDb method testBatchUpdate.
public void testBatchUpdate() throws Exception {
Pet p1 = new Pet();
p1.setPetId(14);
p1.setName("name up 11");
Pet p2 = new Pet();
p2.setPetId(15);
p2.setName("name up 22");
Pet p3 = new Pet();
p3.setPetId(16);
p3.setName("name up 33");
Pet p4 = new Pet();
p4.setPetId(17);
p4.setName("name up 44");
Number[] rs = Db.batchUpdate(new Pet[] { p1, p2, p3, p4 }, "name");
System.out.println(Arrays.asList(rs));
}
use of test.po.Pet in project eweb4j-framework by laiweiwei.
the class TestDb method testBatchInsert.
public void testBatchInsert() throws Exception {
Pet p1 = new Pet();
p1.setName("pet_1");
Pet p2 = new Pet();
p2.setName("pet_2");
Pet p3 = new Pet();
p3.setName("pet_3");
Pet p4 = new Pet();
p4.setName("pet_4");
// Number[] ids = DAOFactory.getInsertDAO().batchInsert(p1, p2, p3, p4);
// System.out.println(Arrays.asList(ids));
Db.batchInsert(new Pet[] { p1, p2, p3, p4 }, "name");
System.out.println(CommonUtil.toJson(Arrays.asList(p1, p2, p3, p4)));
}
use of test.po.Pet in project eweb4j-framework by laiweiwei.
the class TestDb method testBatchDelete.
public void testBatchDelete() throws Exception {
Pet p1 = new Pet();
p1.setPetId(31L);
Pet p2 = new Pet();
p2.setPetId(32L);
Pet p3 = new Pet();
p3.setPetId(33L);
Number[] rs = Db.batchDelete(new Pet[] { p1, p2, p3 });
System.out.println(Arrays.asList(rs));
}
use of test.po.Pet in project eweb4j-framework by laiweiwei.
the class TestDb method testShow.
public void testShow() throws Exception {
Pet db_pet = Pet.inst.find("name = ? and createAt > ?", "testName", Timestamp.valueOf("2013-03-06 14:30:10")).first();
db_pet = Db.ar(Pet.class).dao().selectAll().where().field("name").equal("testName").and("createAt").moreThan(Timestamp.valueOf("2013-03-06 14:30:10")).queryOne();
System.out.println(CommonUtil.toJson(db_pet));
}
use of test.po.Pet in project eweb4j-framework by laiweiwei.
the class TestDb method testInsert.
public void testInsert() throws Exception {
Pet pet = new Pet();
pet.setName("testName2222");
pet.setPetId(29);
Db.ar(pet).save();
}
Aggregations