use of org.seasar.doma.it.dao.EmployeeDaoImpl in project doma by domaframework.
the class AutoDeleteTest method testSuppressOptimisticLockException.
@Test
public void testSuppressOptimisticLockException(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
Employee employee1 = dao.selectById(1);
employee1.setEmployeeName("hoge");
Employee employee2 = dao.selectById(1);
employee2.setEmployeeName("foo");
dao.delete(employee1);
dao.delete_suppressOptimisticLockException(employee2);
}
use of org.seasar.doma.it.dao.EmployeeDaoImpl in project doma by domaframework.
the class AutoDeleteTest method test.
@Test
public void test(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
Employee employee = new Employee();
employee.setEmployeeId(1);
employee.setVersion(1);
int result = dao.delete(employee);
assertEquals(1, result);
employee = dao.selectById(Integer.valueOf(1));
assertNull(employee);
}
use of org.seasar.doma.it.dao.EmployeeDaoImpl in project doma by domaframework.
the class AutoBatchDeleteTest method testIgnoreVersion.
@Test
public void testIgnoreVersion(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
Employee employee = new Employee();
employee.setEmployeeId(1);
employee.setVersion(99);
Employee employee2 = new Employee();
employee2.setEmployeeId(2);
employee2.setVersion(99);
int[] result = dao.delete_ignoreVersion(Arrays.asList(employee, employee2));
assertEquals(2, result.length);
assertEquals(1, result[0]);
assertEquals(1, result[1]);
employee = dao.selectById(1);
assertNull(employee);
employee = dao.selectById(2);
assertNull(employee);
}
use of org.seasar.doma.it.dao.EmployeeDaoImpl in project doma by domaframework.
the class AutoBatchDeleteTest method testSuppressOptimisticLockException.
@Test
public void testSuppressOptimisticLockException(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
Employee employee1 = dao.selectById(1);
employee1.setEmployeeName("hoge");
Employee employee2 = dao.selectById(2);
employee2.setEmployeeName("foo");
Employee employee3 = dao.selectById(1);
employee2.setEmployeeName("bar");
dao.delete(employee1);
dao.delete_suppressOptimisticLockException(Arrays.asList(employee2, employee3));
}
Aggregations