TableConfig添加private Boolean mapperGenerateEnable = Boolean.TRUE,

当值为false,在生成代码时自动给@Table注解添加mapperGenerateEnable = false属性。
This commit is contained in:
稻草人 2023-04-18 22:54:02 +08:00
parent 0293bb4c09
commit 6afc590d16
3 changed files with 27 additions and 14 deletions

View File

@ -48,6 +48,8 @@ public class TableConfig {
private Map<String, ColumnConfig> columnConfigMap;
private Boolean mapperGenerateEnable = Boolean.TRUE;
public String getTableName() {
return tableName;
@ -105,6 +107,14 @@ public class TableConfig {
this.columnConfigMap = columnConfigMap;
}
public Boolean getMapperGenerateEnable() {
return mapperGenerateEnable;
}
public void setMapperGenerateEnable(Boolean mapperGenerateEnable) {
this.mapperGenerateEnable = mapperGenerateEnable;
}
public void addColumnConfig(ColumnConfig columnConfig) {
if (columnConfigMap == null) {
columnConfigMap = new HashMap<>();

View File

@ -249,6 +249,9 @@ public class Table {
if (tableConfig.getSetListenerClass() != null) {
tableAnnotation.append(", onSet = " + tableConfig.getUpdateListenerClass().getSimpleName() + ".class");
}
if (Boolean.FALSE.equals(tableConfig.getMapperGenerateEnable())) {
tableAnnotation.append(", mapperGenerateEnable = false");
}
}
return tableAnnotation.append(")").toString();
}