use of org.seasar.doma.it.entity.NoId in project doma by domaframework.
the class AutoInsertTest method testNoId.
@Test
public void testNoId(Config config) throws Exception {
NoIdDao dao = new NoIdDaoImpl(config);
NoId entity = new NoId();
entity.setValue1(1);
entity.setValue2(2);
int result = dao.insert(entity);
assertEquals(1, result);
}
use of org.seasar.doma.it.entity.NoId in project doma by domaframework.
the class AutoBatchUpdateTest method testNoId.
@Test
public void testNoId(Config config) throws Exception {
NoIdDao dao = new NoIdDaoImpl(config);
NoId entity = new NoId();
entity.setValue1(1);
entity.setValue2(2);
NoId entity2 = new NoId();
entity2.setValue1(1);
entity2.setValue2(2);
try {
dao.update(Arrays.asList(entity, entity2));
fail();
} catch (JdbcException expected) {
assertEquals(Message.DOMA2022, expected.getMessageResource());
}
}
use of org.seasar.doma.it.entity.NoId in project doma by domaframework.
the class AutoDeleteTest method testNoId.
@Test
public void testNoId(Config config) throws Exception {
NoIdDao dao = new NoIdDaoImpl(config);
NoId entity = new NoId();
entity.setValue1(1);
entity.setValue2(2);
try {
dao.delete(entity);
fail();
} catch (JdbcException expected) {
assertEquals(Message.DOMA2022, expected.getMessageResource());
}
}
use of org.seasar.doma.it.entity.NoId in project doma by domaframework.
the class AutoUpdateTest method testNoId.
@Test
public void testNoId(Config config) throws Exception {
NoIdDao dao = new NoIdDaoImpl(config);
NoId entity = new NoId();
entity.setValue1(1);
entity.setValue2(2);
try {
dao.update(entity);
fail();
} catch (JdbcException expected) {
assertEquals(Message.DOMA2022, expected.getMessageResource());
}
}
use of org.seasar.doma.it.entity.NoId in project doma by domaframework.
the class AutoBatchInsertTest method testNoId.
@Test
public void testNoId(Config config) throws Exception {
NoIdDao dao = new NoIdDaoImpl(config);
NoId entity = new NoId();
entity.setValue1(1);
entity.setValue2(2);
NoId entity2 = new NoId();
entity2.setValue1(1);
entity2.setValue2(2);
int[] result = dao.insert(Arrays.asList(entity, entity2));
assertEquals(2, result.length);
assertEquals(1, result[0]);
assertEquals(1, result[1]);
}
Aggregations