Search in sources :

Example 6 with Employee

use of org.seasar.doma.it.entity.Employee in project doma by domaframework.

the class AutoFunctionTest method testResultSetAndUpdate2.

@Test
@Run(unless = { Dbms.MYSQL, Dbms.SQLSERVER })
public void testResultSetAndUpdate2(Config config) throws Exception {
    FunctionDao dao = new FunctionDaoImpl(config);
    List<Employee> result = dao.func_resultset_update2(Integer.valueOf(1));
    assertEquals(13, result.size());
    DepartmentDao departmentDao = new DepartmentDaoImpl(config);
    Department department = departmentDao.selectById(Integer.valueOf(1));
    assertEquals("HOGE", department.getDepartmentName());
}
Also used : DepartmentDaoImpl(org.seasar.doma.it.dao.DepartmentDaoImpl) Department(org.seasar.doma.it.entity.Department) Employee(org.seasar.doma.it.entity.Employee) FunctionDaoImpl(org.seasar.doma.it.dao.FunctionDaoImpl) DepartmentDao(org.seasar.doma.it.dao.DepartmentDao) FunctionDao(org.seasar.doma.it.dao.FunctionDao) Test(org.junit.jupiter.api.Test) Run(org.seasar.doma.it.Run)

Example 7 with Employee

use of org.seasar.doma.it.entity.Employee in project doma by domaframework.

the class PrimitiveTypeTest method map_null_to_reference_type.

@Test
void map_null_to_reference_type(Config config) {
    EmployeeDao dao = new EmployeeDaoImpl(config);
    Employee e = dao.selectById(9);
    Integer managerId = e.getManagerId();
    assertNull(managerId);
}
Also used : EmployeeDao(org.seasar.doma.it.dao.EmployeeDao) PhantomEmployeeDao(org.seasar.doma.it.dao.PhantomEmployeeDao) Employee(org.seasar.doma.it.entity.Employee) PhantomEmployee(org.seasar.doma.it.entity.PhantomEmployee) EmployeeDaoImpl(org.seasar.doma.it.dao.EmployeeDaoImpl) PhantomEmployeeDaoImpl(org.seasar.doma.it.dao.PhantomEmployeeDaoImpl) Test(org.junit.jupiter.api.Test)

Example 8 with Employee

use of org.seasar.doma.it.entity.Employee in project doma by domaframework.

the class AutoProcedureTest method testResultSet_check.

@Test
public void testResultSet_check(Config config) throws Exception {
    ProcedureDao dao = new ProcedureDaoImpl(config);
    List<Employee> employees = new ArrayList<>();
    try {
        dao.proc_resultset_check(employees, 1);
        fail();
    } catch (ResultMappingException ignored) {
        System.err.println(ignored);
    }
}
Also used : ProcedureDao(org.seasar.doma.it.dao.ProcedureDao) Employee(org.seasar.doma.it.entity.Employee) ProcedureDaoImpl(org.seasar.doma.it.dao.ProcedureDaoImpl) ArrayList(java.util.ArrayList) ResultMappingException(org.seasar.doma.jdbc.ResultMappingException) Test(org.junit.jupiter.api.Test)

Example 9 with Employee

use of org.seasar.doma.it.entity.Employee in project doma by domaframework.

the class AutoProcedureTest method testResultSetAndUpdate.

@Test
public void testResultSetAndUpdate(Config config) throws Exception {
    ProcedureDao dao = new ProcedureDaoImpl(config);
    List<Employee> employees = new ArrayList<>();
    dao.proc_resultset_update(employees, 1);
    assertEquals(13, employees.size());
    DepartmentDao departmentDao = new DepartmentDaoImpl(config);
    Department department = departmentDao.selectById(1);
    assertEquals("HOGE", department.getDepartmentName());
}
Also used : DepartmentDaoImpl(org.seasar.doma.it.dao.DepartmentDaoImpl) Department(org.seasar.doma.it.entity.Department) ProcedureDao(org.seasar.doma.it.dao.ProcedureDao) Employee(org.seasar.doma.it.entity.Employee) ProcedureDaoImpl(org.seasar.doma.it.dao.ProcedureDaoImpl) ArrayList(java.util.ArrayList) DepartmentDao(org.seasar.doma.it.dao.DepartmentDao) Test(org.junit.jupiter.api.Test)

Example 10 with Employee

use of org.seasar.doma.it.entity.Employee in project doma by domaframework.

the class AutoProcedureTest method testResultSets.

@Test
public void testResultSets(Config config) throws Exception {
    ProcedureDao dao = new ProcedureDaoImpl(config);
    List<Employee> employees = new ArrayList<>();
    List<Department> departments = new ArrayList<>();
    dao.proc_resultsets(employees, departments, 1, 1);
    assertEquals(13, employees.size());
    assertEquals(3, departments.size());
}
Also used : Department(org.seasar.doma.it.entity.Department) ProcedureDao(org.seasar.doma.it.dao.ProcedureDao) Employee(org.seasar.doma.it.entity.Employee) ProcedureDaoImpl(org.seasar.doma.it.dao.ProcedureDaoImpl) ArrayList(java.util.ArrayList) Test(org.junit.jupiter.api.Test)

Aggregations

Employee (org.seasar.doma.it.entity.Employee)63 Test (org.junit.jupiter.api.Test)61 EmployeeDao (org.seasar.doma.it.dao.EmployeeDao)40 EmployeeDaoImpl (org.seasar.doma.it.dao.EmployeeDaoImpl)40 Run (org.seasar.doma.it.Run)11 ArrayList (java.util.ArrayList)8 CompKeyEmployeeDao (org.seasar.doma.it.dao.CompKeyEmployeeDao)8 CompKeyEmployeeDaoImpl (org.seasar.doma.it.dao.CompKeyEmployeeDaoImpl)8 ProcedureDao (org.seasar.doma.it.dao.ProcedureDao)8 ProcedureDaoImpl (org.seasar.doma.it.dao.ProcedureDaoImpl)8 CompKeyEmployee (org.seasar.doma.it.entity.CompKeyEmployee)8 SelectBuilder (org.seasar.doma.jdbc.builder.SelectBuilder)7 Department (org.seasar.doma.it.entity.Department)6 SelectOptions (org.seasar.doma.jdbc.SelectOptions)5 DepartmentDao (org.seasar.doma.it.dao.DepartmentDao)4 DepartmentDaoImpl (org.seasar.doma.it.dao.DepartmentDaoImpl)4 FunctionDao (org.seasar.doma.it.dao.FunctionDao)4 FunctionDaoImpl (org.seasar.doma.it.dao.FunctionDaoImpl)4 Config (org.seasar.doma.jdbc.Config)3 BigDecimal (java.math.BigDecimal)2