diff --git a/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java b/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java index ebd0187ffd7..4fdc14b4920 100644 --- a/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java @@ -33,21 +33,21 @@ public void setNonNullParameter(PreparedStatement ps, int i, Date parameter, Jdb @Override public Date getNullableResult(ResultSet rs, String columnName) throws SQLException { - return toSqlDate(rs.getDate(columnName)); + return toDate(rs.getDate(columnName)); } @Override public Date getNullableResult(ResultSet rs, int columnIndex) throws SQLException { - return toSqlDate(rs.getDate(columnIndex)); + return toDate(rs.getDate(columnIndex)); } @Override public Date getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { - return toSqlDate(cs.getDate(columnIndex)); + return toDate(cs.getDate(columnIndex)); } - private java.sql.Date toSqlDate(Date date) { - return date == null ? null : new java.sql.Date(date.getTime()); + private Date toDate(java.sql.Date date) { + return date == null ? null : new Date(date.getTime()); } }