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