Skip to content

Commit 64a2736

Browse files
authored
Merge pull request #3334 from JoshKloster/fixDateOnlyTypeHandlerReturnType
DateOnlyTypeHandler should return java.util.Date
2 parents f7e6d98 + 6a1d9b8 commit 64a2736

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ public void setNonNullParameter(PreparedStatement ps, int i, Date parameter, Jdb
3333

3434
@Override
3535
public Date getNullableResult(ResultSet rs, String columnName) throws SQLException {
36-
return toSqlDate(rs.getDate(columnName));
36+
return toDate(rs.getDate(columnName));
3737
}
3838

3939
@Override
4040
public Date getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
41-
return toSqlDate(rs.getDate(columnIndex));
41+
return toDate(rs.getDate(columnIndex));
4242
}
4343

4444
@Override
4545
public Date getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
46-
return toSqlDate(cs.getDate(columnIndex));
46+
return toDate(cs.getDate(columnIndex));
4747
}
4848

49-
private java.sql.Date toSqlDate(Date date) {
50-
return date == null ? null : new java.sql.Date(date.getTime());
49+
private Date toDate(java.sql.Date date) {
50+
return date == null ? null : new Date(date.getTime());
5151
}
5252

5353
}

0 commit comments

Comments
 (0)