Skip to content

Commit 7a233ae

Browse files
Fix DefaultMapper to provide accurate Timestamp by default
1 parent 492a7a7 commit 7a233ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/javawebstack/orm/mapper/DefaultMapper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public Object mapToSQL(Object source, Class<?> type) {
3535
return String.valueOf(source);
3636
if (type.equals(UUID.class))
3737
return source.toString();
38-
38+
if (type.equals(Timestamp.class))
39+
return ((Timestamp) source).toString();
3940
return source;
4041
}
4142

@@ -105,6 +106,8 @@ public String getTypeParameters(Class<?> type, int size) {
105106
return "36";
106107
if (type.equals(boolean.class) || type.equals(Boolean.class) || type.equals(char.class))
107108
return "1";
109+
if (type.equals(Timestamp.class))
110+
return "6";
108111
return null;
109112
}
110113

0 commit comments

Comments
 (0)