Search in sources :

Example 1 with ProcedureDao

use of org.seasar.doma.it.dao.ProcedureDao 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 2 with ProcedureDao

use of org.seasar.doma.it.dao.ProcedureDao 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 3 with ProcedureDao

use of org.seasar.doma.it.dao.ProcedureDao in project doma by domaframework.

the class AutoProcedureTest method testNoParam.

@Test
public void testNoParam(Config config) throws Exception {
    ProcedureDao dao = new ProcedureDaoImpl(config);
    dao.proc_none_param();
}
Also used : ProcedureDao(org.seasar.doma.it.dao.ProcedureDao) ProcedureDaoImpl(org.seasar.doma.it.dao.ProcedureDaoImpl) Test(org.junit.jupiter.api.Test)

Example 4 with ProcedureDao

use of org.seasar.doma.it.dao.ProcedureDao in project doma by domaframework.

the class AutoProcedureTest method testOneParam_time.

@Test
public void testOneParam_time(Config config) throws Exception {
    ProcedureDao dao = new ProcedureDaoImpl(config);
    dao.proc_simpletype_time_param(Time.valueOf("12:34:56"));
}
Also used : ProcedureDao(org.seasar.doma.it.dao.ProcedureDao) ProcedureDaoImpl(org.seasar.doma.it.dao.ProcedureDaoImpl) Test(org.junit.jupiter.api.Test)

Example 5 with ProcedureDao

use of org.seasar.doma.it.dao.ProcedureDao 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

Test (org.junit.jupiter.api.Test)14 ProcedureDao (org.seasar.doma.it.dao.ProcedureDao)14 ProcedureDaoImpl (org.seasar.doma.it.dao.ProcedureDaoImpl)14 ArrayList (java.util.ArrayList)9 Employee (org.seasar.doma.it.entity.Employee)8 Department (org.seasar.doma.it.entity.Department)4 Reference (org.seasar.doma.jdbc.Reference)4 DepartmentDao (org.seasar.doma.it.dao.DepartmentDao)2 DepartmentDaoImpl (org.seasar.doma.it.dao.DepartmentDaoImpl)2 Time (java.sql.Time)1 Map (java.util.Map)1 ResultMappingException (org.seasar.doma.jdbc.ResultMappingException)1