Package com.loc.pojo

Examples of com.loc.pojo.Users


  private BaseDao baseDao;
 
  @SuppressWarnings("unchecked")
  public Users findByName(String account) throws Exception {
    String sql = "select * from loc_user where user_account='"+account+"'";
    Users user = baseDao.queryForObject(sql, Users.mapRow(Users.class));
    return user;
  }
View Full Code Here


    this.userCache = userCache;
  }

  public UserDetails loadUserByUsername(String username)
      throws UsernameNotFoundException, DataAccessException {
    Users users = null;
    try {
      users = this.usersDao.findByName(username);
    } catch (Exception e) {
      e.printStackTrace();
    }
    if (users == null) {
      throw new UsernameNotFoundException(username);
    }
    Collection<GrantedAuthority> grantedAuthorities = null;
    try {
      grantedAuthorities = obtionGrantedAuthorities(users);
    } catch (Exception e) {
      e.printStackTrace();
    }
    boolean enables = true;
    boolean accountNonExpried = true;
    boolean credentialsNonExpried = true;
    boolean accountNonLocked = true;
    User userdetail = new User(users.getUser_account(), users.getUser_password(),
        enables, accountNonExpried, credentialsNonExpried,
        accountNonLocked, grantedAuthorities);
    return userdetail;
  }
View Full Code Here

TOP

Related Classes of com.loc.pojo.Users

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.