SqlMapClientImpl client = (SqlMapClientImpl) context.getBean("master-sqlMapClient");
Assert.assertNotNull(client);
SqlMapExecutorWrapper wrapper = new SqlMapExecutorWrapper(client, client);
wrapper.insert("User.insert", new User(12345678, "aaa"));
{
Exception error = null;
try {
wrapper.insert("User.insert");
} catch (Exception ex) {
error = ex;
}
Assert.assertNotNull(error);
}
wrapper.update("User.update", new User(12345678, "bbb"));
{
Exception error = null;
try {
wrapper.update("User.update");
} catch (Exception ex) {
error = ex;
}
Assert.assertNotNull(error);
}
Assert.assertNotNull((User) wrapper.queryForObject("User.select"));
Assert.assertNotNull((User) wrapper.queryForObject("User.select", Collections.emptyMap()));
Assert.assertNotNull((User) wrapper.queryForObject("User.select", Collections.emptyMap(), new User()));
Assert.assertEquals(1, wrapper.queryForList("User.select").size());
Assert.assertEquals(1, wrapper.queryForList("User.select", Collections.emptyMap()).size());
Assert.assertEquals(1, wrapper.queryForList("User.select", Collections.emptyMap(), 0, 2).size());