use of org.seasar.doma.it.dao.PhantomEmployeeDao in project doma by domaframework.
the class PrimitiveTypeTest method map_null_to_primitive_type.
@Test
void map_null_to_primitive_type(Config config) {
PhantomEmployeeDao dao = new PhantomEmployeeDaoImpl(config);
PhantomEmployee e = dao.selectById(9);
byte managerId = e.getManagerId();
assertEquals((byte) 0, managerId);
}
use of org.seasar.doma.it.dao.PhantomEmployeeDao in project doma by domaframework.
the class PrimitiveTypeTest method select_primitive_types.
@Test
void select_primitive_types(Config config) {
PhantomEmployeeDao dao = new PhantomEmployeeDaoImpl(config);
Map<Integer, PhantomEmployee> map = dao.selectAll().stream().collect(Collectors.toMap(PhantomEmployee::getEmployeeId, Function.identity()));
assertEquals(14, map.size());
PhantomEmployee e = map.get(1);
assertEquals(7369f, e.getEmployeeNo());
assertEquals((byte) 13, e.getManagerId());
assertEquals(800d, e.getSalary().getValue());
assertEquals(2f, e.getDepartmentId());
assertEquals(1d, e.getAddressId());
assertEquals(1L, e.getVersion());
}
Aggregations