Search in sources :

Example 1 with FunctionDaoImpl

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

the class AutoFunctionTest method testOneParam.

@Test
public void testOneParam(Config config) throws Exception {
    FunctionDao dao = new FunctionDaoImpl(config);
    Integer result = dao.func_simpletype_param(Integer.valueOf(10));
    assertEquals(Integer.valueOf(20), result);
}
Also used : FunctionDaoImpl(org.seasar.doma.it.dao.FunctionDaoImpl) FunctionDao(org.seasar.doma.it.dao.FunctionDao) Test(org.junit.jupiter.api.Test)

Example 2 with FunctionDaoImpl

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

the class AutoFunctionTest method testResultSet_check.

@Test
@Run(unless = { Dbms.MYSQL, Dbms.SQLSERVER })
public void testResultSet_check(Config config) throws Exception {
    FunctionDao dao = new FunctionDaoImpl(config);
    try {
        dao.func_resultset_check(Integer.valueOf(1));
        fail();
    } catch (ResultMappingException ignored) {
        System.err.println(ignored);
    }
}
Also used : FunctionDaoImpl(org.seasar.doma.it.dao.FunctionDaoImpl) ResultMappingException(org.seasar.doma.jdbc.ResultMappingException) FunctionDao(org.seasar.doma.it.dao.FunctionDao) Test(org.junit.jupiter.api.Test) Run(org.seasar.doma.it.Run)

Example 3 with FunctionDaoImpl

use of org.seasar.doma.it.dao.FunctionDaoImpl 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());
}
Also used : Employee(org.seasar.doma.it.entity.Employee) FunctionDaoImpl(org.seasar.doma.it.dao.FunctionDaoImpl) FunctionDao(org.seasar.doma.it.dao.FunctionDao) Test(org.junit.jupiter.api.Test) Run(org.seasar.doma.it.Run)

Example 4 with FunctionDaoImpl

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

the class AutoFunctionTest method testScalarResultSet.

@Test
@Run(onlyIf = { Dbms.POSTGRESQL })
public void testScalarResultSet(Config config) throws Exception {
    FunctionDao dao = new FunctionDaoImpl(config);
    List<String> result = dao.func_simpletype_resultset(Integer.valueOf(1));
    assertEquals(13, result.size());
    assertEquals("ALLEN", result.get(0));
}
Also used : FunctionDaoImpl(org.seasar.doma.it.dao.FunctionDaoImpl) FunctionDao(org.seasar.doma.it.dao.FunctionDao) Test(org.junit.jupiter.api.Test) Run(org.seasar.doma.it.Run)

Example 5 with FunctionDaoImpl

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

the class AutoFunctionTest method testTwoParams_time.

@Test
public void testTwoParams_time(Config config) throws Exception {
    FunctionDao dao = new FunctionDaoImpl(config);
    Time result = dao.func_dto_time_param(Time.valueOf("12:34:56"), Integer.valueOf(20));
    assertEquals(Time.valueOf("12:34:56"), result);
}
Also used : Time(java.sql.Time) FunctionDaoImpl(org.seasar.doma.it.dao.FunctionDaoImpl) FunctionDao(org.seasar.doma.it.dao.FunctionDao) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)12 FunctionDao (org.seasar.doma.it.dao.FunctionDao)12 FunctionDaoImpl (org.seasar.doma.it.dao.FunctionDaoImpl)12 Run (org.seasar.doma.it.Run)7 Employee (org.seasar.doma.it.entity.Employee)4 Time (java.sql.Time)2 DepartmentDao (org.seasar.doma.it.dao.DepartmentDao)2 DepartmentDaoImpl (org.seasar.doma.it.dao.DepartmentDaoImpl)2 Department (org.seasar.doma.it.entity.Department)2 Map (java.util.Map)1 ResultMappingException (org.seasar.doma.jdbc.ResultMappingException)1