Search in sources :

Example 11 with Employee

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

the class SqlFileSelectCountTest method test.

@Test
public void test(Config config) throws Exception {
    EmployeeDao dao = new EmployeeDaoImpl(config);
    SelectOptions options = SelectOptions.get().count();
    List<Employee> employees = dao.selectAll(options);
    assertEquals(14, employees.size());
    assertEquals(14, options.getCount());
}
Also used : EmployeeDao(org.seasar.doma.it.dao.EmployeeDao) Employee(org.seasar.doma.it.entity.Employee) SelectOptions(org.seasar.doma.jdbc.SelectOptions) EmployeeDaoImpl(org.seasar.doma.it.dao.EmployeeDaoImpl) Test(org.junit.jupiter.api.Test)

Example 12 with Employee

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

Example 13 with Employee

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

Example 14 with Employee

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

Example 15 with Employee

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

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