use of test.po.Pet in project eweb4j-framework by laiweiwei.
the class CRUDTest method testUpdate.
public void testUpdate() throws Exception {
Pet pet = new Pet();
pet.setPetId(2);
pet.setAge(12);
pet.setName("i'm laiweiwei too");
Models.inst(pet).save("age", "name");
Assert.assertEquals(2, pet.getPetId());
Assert.assertEquals(12, pet.getAge());
Assert.assertEquals("i'm laiweiwei too", pet.getName());
}
use of test.po.Pet in project eweb4j-framework by laiweiwei.
the class CRUDTest method testSelect.
public void testSelect() throws Exception {
Pet pet = DAOFactory.getDAO(Pet.class).selectAll().where().field("name").equal("i'm laiweiwei").queryOne();
Assert.assertEquals(1, pet.getPetId());
Assert.assertEquals(12, pet.getAge());
Assert.assertEquals("i'm laiweiwei", pet.getName());
}
Aggregations