Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
Change java.sql.Timestamp to java.util.Date
  • Loading branch information
BrookYuGit committed Mar 23, 2022
1 parent bc49824 commit d8307ef
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ public int compare(String o1, String o2) {
}catch(Exception ex) {
ex.printStackTrace();
System.out.println("!!! invalid sql");
throw ex;
}

sql = column.getParameterSql();
Expand Down Expand Up @@ -1255,6 +1256,9 @@ public int compare(String o1, String o2) {
introspectedColumn.setParameterSql("");
introspectedColumn.setParameterSqlValue("");
}
if ("java.sql.Timestamp".equals(introspectedColumn.getFullyQualifiedJavaType().getFullyQualifiedName())) {
introspectedColumn.setFullyQualifiedJavaType(new FullyQualifiedJavaType("java.util.Date"));
}
if (!StringUtils.isEmpty(columnComment)) {
introspectedColumn.setRemarks(columnComment);
}
Expand Down Expand Up @@ -1442,7 +1446,7 @@ public int compare(String o1, String o2) {
System.out.println("==== 附加错误 ======================");
System.out.println(extraErrorInfo);
System.out.println("==========================");
throw new Exception("!!! === sql错误! "+tableName+","+column.getParameterCatalog()+"."+column.getParameterCatalogType()+", "+column.getParameterName()+","+extraErrorInfo);
throw new Exception("!!! === sql错误! "+tableName+","+column.getParameterCatalog()+"."+column.getParameterCatalogType()+", "+column.getParameterName()+","+extraErrorInfo+",ex:"+ex.getMessage());
}

}
Expand Down Expand Up @@ -1564,7 +1568,14 @@ public int compare(String o1, String o2) {

dynTemplate.setExtraInfoMap(new HashMap<>());
if (!StringUtils.isEmpty(item.getExtraInfo())) {
JSONObject extraInfo = JSON.parseObject(item.getExtraInfo());
JSONObject extraInfo;
try {
extraInfo = JSON.parseObject(item.getExtraInfo());
}catch(Exception ex) {
System.out.println(item.getExtraInfo());
ex.printStackTrace();
throw new Exception("template.extra_info非法:"+item.getProjectName()+","+item.getName());
}
for(String jsonKey: extraInfo.keySet()) {
dynTemplate.getExtraInfoMap().put(jsonKey, extraInfo.get(jsonKey));
}
Expand Down

0 comments on commit d8307ef

Please sign in to comment.