فهرست منبع

优化jpa解析

zhou-hao 7 سال پیش
والد
کامیت
989ac54117

+ 3 - 1
hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/builder/jpa/JpaAnnotationParser.java

@@ -56,6 +56,8 @@ public class JpaAnnotationParser {
         jdbcTypeMapping.put(BigInteger.class, JDBCType.INTEGER);
 
         jdbcTypeMapping.put(Date.class, JDBCType.TIMESTAMP);
+        jdbcTypeMapping.put(java.sql.Date.class, JDBCType.TIMESTAMP);
+        jdbcTypeMapping.put(java.sql.Timestamp.class, JDBCType.TIMESTAMP);
 
         jdbcTypeConvert.add((type, property) -> {
             Enumerated enumerated = getAnnotation(type, property, Enumerated.class);
@@ -108,7 +110,7 @@ public class JpaAnnotationParser {
                     return super.getData(value);
                 }
             };
-            
+
             if (columnMetaData.getJdbcType() == JDBCType.DATE) {
                 columnMetaData.setValueConverter(dateConvert);
             } else if (columnMetaData.getJdbcType() == JDBCType.TIMESTAMP) {