use of activerecordtext.AbstractUser in project jSqlBox by drinkjava2.
the class UsuageAndSpeedTest method abstractSqlMapperUseText.
@Test
public void abstractSqlMapperUseText() {
SqlBoxContext ctx = new SqlBoxContext(dataSource);
// use global default context
SqlBoxContext.setGlobalSqlBoxContext(ctx);
AbstractUser user = ActiveRecord.create(AbstractUser.class);
for (int i = 0; i < REPEAT_TIMES; i++) {
user.insertOneUser("Sam", "Canada");
user.ctx().nUpdate(user.updateUserPreparedSQL("Tom", "China"));
// List<Map<String, Object>> users = user.selectUserListMap("Tom", "China");
// Assert.assertEquals(1, users.size());
List<AbstractUser> users2 = user.selectAbstractUserList("Tom", "China");
Assert.assertEquals(1, users2.size());
user.deleteUsers("Tom", "China");
Assert.assertEquals(0, user.ctx().nQueryForLongValue("select count(*) from users"));
}
}
Aggregations