Examples of ExistedException


Examples of com.ketayao.ketacustom.exception.ExistedException

   */
  @Override
  public void saveOrUpdate(User user) {
    if (user.getId() == null) {
      if (userDAO.getByUsername(user.getUsername()) != null) {
        throw new ExistedException("登录名:" + user.getUsername() + "已存在。");
      }
     
      //设定安全的密码,使用passwordService提供的salt并经过1024次 sha-1 hash
      if (StringUtils.isNotBlank(user.getPlainPassword()) && shiroRealm != null) {
        HashPassword hashPassword = ShiroDbRealm.encryptPassword(user.getPlainPassword());
View Full Code Here

Examples of com.ketayao.ketacustom.exception.ExistedException

   */
  @Override
  public void saveOrUpdate(Module module) {
    if (module.getId() == null) {
      if (moduleDAO.getBySn(module.getSn()) != null) {
        throw new ExistedException("已存在sn=" + module.getSn() + "的模块。");
      }
    }

    moduleDAO.save(module);
  }
View Full Code Here

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

Examples of commons.ExistedException

  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

Examples of commons.ExistedException

  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

Examples of commons.ExistedException

  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
Copyright © 2018 www.massapi.com. 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.