Exemplo n.º 1
0
 @Override
 public void updateDepartment(Department department) throws SQLException {
   DatabaseHelper.executeUpdate(
       UPDATE_DEPARTMENT_QUERY,
       department.getDepartmentLongName(),
       department.getDepartmentCode());
 }
Exemplo n.º 2
0
 @Override
 public Department findDepartment(String departmentCode) throws SQLException {
   List<Department> list =
       DatabaseHelper.getResultList(
           FIND_ONE__DEPARTMENT_QUERY, new DepartmentMapper(), departmentCode);
   if (list != null && list.size() > 0) {
     return list.get(0);
   }
   return null;
 }
Exemplo n.º 3
0
 @Override
 public boolean removeDepartment(String departmentCode) throws SQLException {
   return DatabaseHelper.executeUpdate(DELETE_DEPARTMENT_QUERY, departmentCode);
 }
Exemplo n.º 4
0
 @Override
 public List<Department> findDepartments() throws SQLException {
   return DatabaseHelper.getResultList(FIND_ALL_DEPARTMENT_QUERY, new DepartmentMapper());
 }