Showing
1 changed file
with
8 additions
and
3 deletions
... | ... | @@ -20,24 +20,29 @@ import java.sql.ResultSet; |
20 | 20 | import java.sql.SQLException; |
21 | 21 | import java.util.Arrays; |
22 | 22 | import java.util.List; |
23 | +import java.util.Optional; | |
23 | 24 | |
24 | 25 | public class ListStringTypeHandler extends BaseTypeHandler { |
25 | 26 | |
26 | 27 | @Override |
27 | 28 | public Object getNullableResult(ResultSet rs, String columnName) |
28 | 29 | throws SQLException { |
29 | - return Arrays.asList(rs.getString(columnName).split(",")); | |
30 | + | |
31 | + String value = rs.getString(columnName); | |
32 | + return value ==null?null:Arrays.asList(value.split(",")); | |
30 | 33 | } |
31 | 34 | |
32 | 35 | @Override |
33 | 36 | public Object getNullableResult(ResultSet resultSet, int i) throws SQLException { |
34 | - return Arrays.asList(resultSet.getString(i).split(",")); | |
37 | + String value = resultSet.getString(i); | |
38 | + return value ==null?null:Arrays.asList(value.split(",")); | |
35 | 39 | } |
36 | 40 | |
37 | 41 | @Override |
38 | 42 | public Object getNullableResult(CallableStatement cs, int columnIndex) |
39 | 43 | throws SQLException { |
40 | - return Arrays.asList(cs.getString(columnIndex).split(",")); | |
44 | + String value = cs.getString(columnIndex); | |
45 | + return value ==null?null:Arrays.asList(value.split(",")); | |
41 | 46 | } |
42 | 47 | |
43 | 48 | @Override | ... | ... |