【更新】代码生成字段类型兼容pgsql

pull/22/head
xuyuxiang 2021-04-19 19:09:45 +08:00
parent 92de5355af
commit db42003739
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,10 @@ public class JavaSqlTool {
public static String sqlToJava (String sqlType) {
if( sqlType == null || sqlType.trim().length() == 0 ) return sqlType;
sqlType = sqlType.toLowerCase();
if(sqlType.startsWith("int")) {
//如果以int开头则直接返回int兼容pgsql中int2 int8等
return "Integer";
}
switch(sqlType){
case "nvarchar":return "String";
case "nvarchar2":return "String";