private static final class UserMapper
implements RowMapper {
@NotNull
public Object mapRow(@NotNull ResultSet rs, int rowNum)
throws SQLException {
SaikuUser user = new SaikuUser();
user.setId(rs.getInt("user_id"));
user.setUsername(rs.getString("username"));
user.setEmail(rs.getString("email"));
user.setPassword(rs.getString("password"));
if (rs.getString("ROLES") != null) {
List<String> list = new ArrayList(Arrays.asList(rs.getString("ROLES").split(",")));
String[] stockArr = new String[list.size()];
stockArr = (String[]) list.toArray(stockArr);
user.setRoles(stockArr);
}
return user;
}