Package commons

Examples of commons.ExistedException


  public User addUser(User u) throws ExistedException {
    if(u==null)
      throw new NullPointerException("user should not be null");
    User user=userDao.findByEmailName(u.getEmail());
    if(user!=null)
      throw new ExistedException();
    return userDao.addUser(u);
  }
View Full Code Here


  public User updateUser(User user) throws NotFoundException, ExistedException {
    if(user==null)
      throw new NullPointerException("user should not be null");
    User us=userDao.findByEmailName(user.getEmail());
    if( us!=null && user.getId()!=us.getId())
      throw new ExistedException();
    return   userDao.updateUser(user);
  }
View Full Code Here

  public Authority addAuthory(Authority authory) throws ExistedException{
    if(authory==null)
      throw new NullPointerException("authory should not be null");
    Authority auth=authoryDao.findByName(authory.getName());
    if(auth!=null)
      throw new ExistedException();
    authory=authoryDao.addAuthory(authory);
    return authory;
  }
View Full Code Here

  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;
  }
View Full Code Here

TOP

Related Classes of commons.ExistedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.