use of org.seasar.doma.it.dao.EmployeeDaoImpl in project doma by domaframework.
the class SqlFileSelectCountTest method testCountUnspecified.
@Test
public void testCountUnspecified(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
SelectOptions options = SelectOptions.get();
List<Employee> employees = dao.selectAll(options);
assertEquals(14, employees.size());
assertEquals(-1, options.getCount());
}
use of org.seasar.doma.it.dao.EmployeeDaoImpl in project doma by domaframework.
the class SqlFileSelectForUpdateTest method testForUpdateWithColumns.
@Test
@Run(unless = { Dbms.HSQLDB, Dbms.H2, Dbms.POSTGRESQL, Dbms.MYSQL, Dbms.DB2, Dbms.SQLSERVER, Dbms.SQLITE })
public void testForUpdateWithColumns(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
Employee employee = dao.selectById(1, SelectOptions.get().forUpdate("employee_name", "address_id"));
assertNotNull(employee);
}
use of org.seasar.doma.it.dao.EmployeeDaoImpl in project doma by domaframework.
the class SqlFileSelectForUpdateTest method testForUpdateNowait.
@Test
@Run(unless = { Dbms.HSQLDB, Dbms.H2, Dbms.POSTGRESQL, Dbms.MYSQL, Dbms.DB2, Dbms.SQLITE })
public void testForUpdateNowait(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
Employee employee = dao.selectById(1, SelectOptions.get().forUpdateNowait());
assertNotNull(employee);
}
use of org.seasar.doma.it.dao.EmployeeDaoImpl in project doma by domaframework.
the class SqlFileSelectForUpdateTest method testForUpdateWait.
@Test
@Run(unless = { Dbms.HSQLDB, Dbms.H2, Dbms.POSTGRESQL, Dbms.MYSQL, Dbms.DB2, Dbms.SQLSERVER, Dbms.SQLITE })
public void testForUpdateWait(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
Employee employee = dao.selectById(1, SelectOptions.get().forUpdateWait(10));
assertNotNull(employee);
}
use of org.seasar.doma.it.dao.EmployeeDaoImpl in project doma by domaframework.
the class SqlFileSelectForUpdateTest method testUnsupported.
@Test
@Run(unless = { Dbms.H2, Dbms.POSTGRESQL, Dbms.ORACLE, Dbms.MYSQL, Dbms.DB2, Dbms.SQLSERVER })
public void testUnsupported(Config config) throws Exception {
EmployeeDao dao = new EmployeeDaoImpl(config);
try {
dao.selectById(1, SelectOptions.get().forUpdate());
fail();
} catch (JdbcException expected) {
assertEquals(Message.DOMA2023, expected.getMessageResource());
}
}
Aggregations