@Override
 public List<Menu> findMenuByParent(Menu m) {
   if (m == null || !StringUtils.hasText(m.getId())) {
     return new ArrayList<Menu>();
   }
   return menuDao.findMenuByParent(m.getId());
 }
 @Override
 public Menu findMenuById(String id) {
   if (!StringUtils.hasText(id)) {
     return null;
   }
   return menuDao.findOne(id);
 }
  @Override
  public List<Menu> findMenuNotInRole(Role role) {
    if (role == null) {
      return new ArrayList<Menu>();
    }

    Role r = findRoleById(role.getId());
    if (r == null || r.getMenuSet().isEmpty()) {
      return new ArrayList<Menu>();
    }

    List<String> ids = new ArrayList<String>();
    for (Menu m : r.getMenuSet()) {
      ids.add(m.getId());
    }

    return menuDao.findByIdNotIn(ids);
  }
 @Override
 public void delete(Menu m) {
   menuDao.delete(m);
 }
 @Override
 public void save(Menu m) {
   menuDao.save(m);
 }
 @Override
 public Long countAllMenu() {
   return menuDao.count();
 }
 @Override
 public Page<Menu> findAllMenu(Pageable pageable) {
   return menuDao.findAll(pageable);
 }
 @Override
 public List<Menu> findTopLevelMenu() {
   return menuDao.findTopLevelMenu();
 }