Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

生成创建字段的 SQL 默认字段为空字符串时会出现四个分号。 #16

Open
GavinGu0 opened this issue Dec 6, 2022 · 0 comments

Comments

@GavinGu0
Copy link

GavinGu0 commented Dec 6, 2022

简单粗暴的方法是加个if条件
在方法 buildCreateFieldSql()

SqlBuilder.java 125行左右 if改为

  if (StringUtils.isNotBlank(defaultValue)) {
      // 默认值
      String str=defaultValue.trim();
      //判断已经加了分号,不再重复加
      if(str.equalsIgnoreCase("''")){
          fieldStrBuilder.append(" ").append("default ").append("''");
      }
      else {
          fieldStrBuilder.append(" ").append("default ").append(getValueStr(field, defaultValue));
      }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant