mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
简化代码
This commit is contained in:
parent
a3de7ec409
commit
049e54d023
@ -127,6 +127,7 @@ public class EntityProcessor extends AbstractProcessor {
|
||||
.addConstructor(tableInfo)
|
||||
.addFields(tableInfo)
|
||||
.addMethod(tableInfo)
|
||||
.addBuild(tableInfo)
|
||||
);
|
||||
writerFile(tableInfo.getTagClassPackage() + "." + tableInfo.getTagClassName(), content.getContent());
|
||||
return tableInfo;
|
||||
@ -248,6 +249,18 @@ public class EntityProcessor extends AbstractProcessor {
|
||||
return this;
|
||||
}
|
||||
|
||||
public StringBuilderHelper addBuild(TableInfo tableInfo) {
|
||||
sb.append("\tpublic static ").append(tableInfo.getTagClassName()).append(" build() {\n")
|
||||
.append("\t\treturn new ").append(tableInfo.getTagClassName()).append("();\n")
|
||||
.append("\t}\n");
|
||||
newLine();
|
||||
sb.append("\tpublic static ").append(tableInfo.getTagClassName()).append(" build(String alias) {\n")
|
||||
.append("\t\treturn new ").append(tableInfo.getTagClassName()).append("(alias);\n")
|
||||
.append("\t}\n");
|
||||
newLine();
|
||||
return this;
|
||||
}
|
||||
|
||||
private StringBuilderHelper addComment(String prefix, String comment) {
|
||||
if (StringUtil.isNotEmpty(comment)) {
|
||||
sb.append(prefix).append("/**\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user