use of org.seasar.doma.it.entity.Employee in project doma by domaframework.
the class AutoFunctionTest method testResultSet.
@Test
@Run(unless = { Dbms.MYSQL, Dbms.SQLSERVER })
public void testResultSet(Config config) throws Exception {
FunctionDao dao = new FunctionDaoImpl(config);
List<Employee> result = dao.func_resultset(Integer.valueOf(1));
assertEquals(13, result.size());
}
use of org.seasar.doma.it.entity.Employee in project doma by domaframework.
the class AutoFunctionTest method testResultSet_nocheck.
@Test
@Run(unless = { Dbms.MYSQL, Dbms.SQLSERVER })
public void testResultSet_nocheck(Config config) throws Exception {
FunctionDao dao = new FunctionDaoImpl(config);
List<Employee> result = dao.func_resultset_nocheck(Integer.valueOf(1));
assertEquals(13, result.size());
}
use of org.seasar.doma.it.entity.Employee in project doma by domaframework.
the class AutoFunctionTest method testResultSetAndUpdate.
@Test
@Run(unless = { Dbms.MYSQL, Dbms.SQLSERVER })
public void testResultSetAndUpdate(Config config) throws Exception {
FunctionDao dao = new FunctionDaoImpl(config);
List<Employee> result = dao.func_resultset_update(Integer.valueOf(1));
assertEquals(13, result.size());
DepartmentDao departmentDao = new DepartmentDaoImpl(config);
Department department = departmentDao.selectById(Integer.valueOf(1));
assertEquals("HOGE", department.getDepartmentName());
}
use of org.seasar.doma.it.entity.Employee in project doma by domaframework.
the class AutoDeleteTest 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);
int result = dao.delete_ignoreVersion(employee);
assertEquals(1, result);
employee = dao.selectById(Integer.valueOf(1));
assertNull(employee);
}
use of org.seasar.doma.it.entity.Employee in project doma by domaframework.
the class AutoDeleteTest method testOptimisticLockException.
@Test
public void testOptimisticLockException(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
Employee employee1 = dao.selectById(Integer.valueOf(1));
employee1.setEmployeeName("hoge");
Employee employee2 = dao.selectById(Integer.valueOf(1));
employee2.setEmployeeName("foo");
dao.delete(employee1);
try {
dao.delete(employee2);
fail();
} catch (OptimisticLockException expected) {
}
}
Aggregations