Esempio n. 1
0
 @Override
 public void updateDepartment(Department department) throws SQLException {
   DatabaseHelper.executeUpdate(
       UPDATE_DEPARTMENT_QUERY,
       department.getDepartmentLongName(),
       department.getDepartmentCode());
 }
Esempio 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;
 }
Esempio n. 3
0
 @Override
 public boolean removeDepartment(String departmentCode) throws SQLException {
   return DatabaseHelper.executeUpdate(DELETE_DEPARTMENT_QUERY, departmentCode);
 }
Esempio n. 4
0
 @Override
 public List<Department> findDepartments() throws SQLException {
   return DatabaseHelper.getResultList(FIND_ALL_DEPARTMENT_QUERY, new DepartmentMapper());
 }