Package com.ketayao.ketacustom.exception

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


   */
  @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

TOP

Related Classes of com.ketayao.ketacustom.exception.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.