1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.security.oauth2.common.util;
18
19 import java.util.List;
20 import java.util.Map;
21
22 import org.springframework.jdbc.core.RowMapper;
23 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
24
25
26
27
28
29 public class DefaultJdbcListFactory implements JdbcListFactory {
30
31 private final NamedParameterJdbcOperations jdbcTemplate;
32
33
34
35
36 public DefaultJdbcListFactory(NamedParameterJdbcOperations jdbcTemplate) {
37 this.jdbcTemplate = jdbcTemplate;
38 }
39
40 public <T> List<T> getList(String sql, Map<String, Object> parameters, RowMapper<T> rowMapper) {
41 return jdbcTemplate.query(sql, parameters, rowMapper);
42 }
43
44 }