use of org.seasar.doma.it.dao.CompKeyEmployeeDaoImpl in project doma by domaframework.
the class AutoDeleteTest method testCompositeKey.
@Test
public void testCompositeKey(Config config) throws Exception {
CompKeyEmployeeDao dao = new CompKeyEmployeeDaoImpl(config);
CompKeyEmployee employee = new CompKeyEmployee();
employee.setEmployeeId1(1);
employee.setEmployeeId2(1);
employee.setVersion(1);
int result = dao.delete(employee);
assertEquals(1, result);
employee = dao.selectById(Integer.valueOf(1), Integer.valueOf(1));
assertNull(employee);
}
use of org.seasar.doma.it.dao.CompKeyEmployeeDaoImpl in project doma by domaframework.
the class AutoBatchDeleteTest method testCompositeKey.
@Test
public void testCompositeKey(Config config) throws Exception {
CompKeyEmployeeDao dao = new CompKeyEmployeeDaoImpl(config);
CompKeyEmployee employee = new CompKeyEmployee();
employee.setEmployeeId1(1);
employee.setEmployeeId2(1);
employee.setVersion(1);
CompKeyEmployee employee2 = new CompKeyEmployee();
employee2.setEmployeeId1(2);
employee2.setEmployeeId2(2);
employee2.setVersion(1);
int[] result = dao.delete(Arrays.asList(employee, employee2));
assertEquals(2, result.length);
assertEquals(1, result[0]);
assertEquals(1, result[1]);
employee = dao.selectById(1, 1);
assertNull(employee);
employee = dao.selectById(2, 2);
assertNull(employee);
}
Aggregations