5
5
import java .sql .ResultSet ;
6
6
import java .sql .SQLException ;
7
7
8
- public abstract class BaseTypeHandler implements TypeHandler {
8
+ public abstract class BaseTypeHandler < T > implements TypeHandler < T > {
9
9
10
- public void setParameter (PreparedStatement ps , int i , Object parameter , JdbcType jdbcType )
10
+ public void setParameter (PreparedStatement ps , int i , T parameter , JdbcType jdbcType )
11
11
throws SQLException {
12
12
if (parameter == null ) {
13
13
if (jdbcType == null ) {
@@ -24,33 +24,33 @@ public void setParameter(PreparedStatement ps, int i, Object parameter, JdbcType
24
24
}
25
25
}
26
26
27
- public Object getResult (ResultSet rs , String columnName )
27
+ public T getResult (ResultSet rs , String columnName )
28
28
throws SQLException {
29
- Object result = getNullableResult (rs , columnName );
29
+ T result = getNullableResult (rs , columnName );
30
30
if (rs .wasNull ()) {
31
31
return null ;
32
32
} else {
33
33
return result ;
34
34
}
35
35
}
36
36
37
- public Object getResult (CallableStatement cs , int columnIndex )
37
+ public T getResult (CallableStatement cs , int columnIndex )
38
38
throws SQLException {
39
- Object result = getNullableResult (cs , columnIndex );
39
+ T result = getNullableResult (cs , columnIndex );
40
40
if (cs .wasNull ()) {
41
41
return null ;
42
42
} else {
43
43
return result ;
44
44
}
45
45
}
46
46
47
- public abstract void setNonNullParameter (PreparedStatement ps , int i , Object parameter , JdbcType jdbcType )
47
+ public abstract void setNonNullParameter (PreparedStatement ps , int i , T parameter , JdbcType jdbcType )
48
48
throws SQLException ;
49
49
50
- public abstract Object getNullableResult (ResultSet rs , String columnName )
50
+ public abstract T getNullableResult (ResultSet rs , String columnName )
51
51
throws SQLException ;
52
52
53
- public abstract Object getNullableResult (CallableStatement cs , int columnIndex )
53
+ public abstract T getNullableResult (CallableStatement cs , int columnIndex )
54
54
throws SQLException ;
55
55
56
56
}
0 commit comments