Ejemplo n.º 1
0
 public <T> Collection<T> mapMany(ResultSet resultSet, RowMapper<T> mapper) throws Throwable {
   Collection<T> ret = new ArrayList<>();
   while (resultSet.next()) {
     ret.add(mapper.apply(resultSet).getOrElseThrow(Function.identity()));
   }
   return ret;
 }
Ejemplo n.º 2
0
 public <T> T map(ResultSet resultSet, RowMapper<T> mapper) throws Throwable {
   resultSet.next();
   return mapper.apply(resultSet).getOrElseThrow(Function.identity());
 }