private static final class UserMapper implements RowMapper<QxAccount> {
@Override
public QxAccount mapRow(ResultSet rs, int rowNum) throws SQLException {
QxAccount user = new QxAccount();
user.setUsername(rs.getString("USERNAME"));
user.setPassword(rs.getString("PASSWORD"));
user.setEnabled(rs.getBoolean("ENABLED"));
String[] tempAuths = StringUtils.commaDelimitedListToStringArray(rs.getString("AUTHORITIES"));
Collection<SimpleGrantedAuthority> authorities = new HashSet<SimpleGrantedAuthority>();
for (String ta : tempAuths) {
authorities.add(new SimpleGrantedAuthority(ta));
}
user.setAuthorities(authorities);
return user;
}