public Authority updateAuthory(Authority authory) throws ExistedException, NotFoundException{
if(authory==null)
throw new NullPointerException("authory should not be null");
Authority auth=authoryDao.findByName(authory.getName());
if(auth!=null&&authory.getId()!=auth.getId())
throw new ExistedException();
authory=authoryDao.updateAuthory(authory);
return authory;
}