From 3ca9771f49ec59e11213648d45719317b5bcbe12 Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 27 Dec 2024 15:03:02 -0700 Subject: [PATCH 1/2] Change java.sql.Date to java.util.date --- .../org/apache/ibatis/type/DateOnlyTypeHandler.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java b/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java index ebd0187ffd7..0de34b32a19 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(Date date) { + return date == null ? null : new Date(date.getTime()); } } From 6a1d9b8e302d8a4a4e1bc1bfdb11d8013f735e33 Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 27 Dec 2024 15:24:17 -0700 Subject: [PATCH 2/2] change argument type --- src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java b/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java index 0de34b32a19..4fdc14b4920 100644 --- a/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/DateOnlyTypeHandler.java @@ -46,7 +46,7 @@ public Date getNullableResult(CallableStatement cs, int columnIndex) throws SQLE return toDate(cs.getDate(columnIndex)); } - private Date toDate(Date date) { + private Date toDate(java.sql.Date date) { return date == null ? null : new Date(date.getTime()); }