Skip to content

Commit

Permalink
Merge f088540 into 3ea7406
Browse files Browse the repository at this point in the history
  • Loading branch information
tuohai666 committed Aug 15, 2019
2 parents 3ea7406 + f088540 commit 3abb523
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Expand Up @@ -125,6 +125,8 @@ private static Object convertDateValue(final Object value, final Class<?> conver
return new Time(date.getTime());
case "java.sql.Timestamp":
return new Timestamp(date.getTime());
case "java.lang.String":
return date.toString();
default:
throw new ShardingException("Unsupported Date type:%s", convertType);
}
Expand Down
Expand Up @@ -84,6 +84,7 @@ public void assertConvertDateValueSuccess() {
assertThat((java.sql.Date) ResultSetUtil.convertValue(now, java.sql.Date.class), is(now));
assertThat((Time) ResultSetUtil.convertValue(now, Time.class), is(now));
assertThat((Timestamp) ResultSetUtil.convertValue(now, Timestamp.class), is(new Timestamp(now.getTime())));
assertThat((String) ResultSetUtil.convertValue(now, String.class), is(now.toString()));
}

@Test
Expand Down

0 comments on commit 3abb523

Please sign in to comment.