/*
  * (non-Javadoc)
  *
  * @see
  * com.systemsinmotion.orgchart.dao.DepartmentDAO#findByParentDepartment
  * (com.systemsinmotion.orgchart.entity.Department)
  */
 @SuppressWarnings("unchecked")
 public List<Department> findByParentDepartment(Department department) {
   LOG.debug("finding child Departments for Department: " + department.getName());
   try {
     return this.hibernateTemplate.find(
         "from Department where parentDepartment.departmentId=?", department.getDepartmentId());
   } catch (RuntimeException re) {
     LOG.error("lookup failed", re);
     throw re;
   }
 }
 /*
  * (non-Javadoc)
  *
  * @see
  * com.systemsinmotion.orgchart.dao.DepartmentDAO#delete(com.systemsinmotion
  * .orgchart.entity.Department)
  */
 public void delete(Department department) {
   LOG.debug("deleting Department instance with name: " + department.getName());
   try {
     this.hibernateTemplate.delete(department);
   } catch (RuntimeException re) {
     LOG.error("delete failed", re);
     throw re;
   }
 }
 /*
  * (non-Javadoc)
  *
  * @see
  * com.systemsinmotion.orgchart.dao.DepartmentDAO#save(com.systemsinmotion
  * .orgchart.entity.Department)
  */
 public Integer save(Department department) {
   LOG.debug("saving Department instance with name: " + department.getName());
   try {
     return (Integer) this.hibernateTemplate.save(department);
   } catch (RuntimeException re) {
     LOG.error("save failed", re);
     throw re;
   }
 }