|
@@ -257,7 +257,7 @@ public class ConfigBuilder {
|
|
|
}
|
|
|
|
|
|
private void setPathInfo(Map<String, String> pathInfo, String template, String outputDir, String path, String module) {
|
|
|
- if (StringUtils.isNotEmpty(template)) {
|
|
|
+ if (StringUtils.isNotBlank(template)) {
|
|
|
pathInfo.put(path, joinPath(outputDir, packageInfo.get(module)));
|
|
|
}
|
|
|
}
|
|
@@ -290,17 +290,17 @@ public class ConfigBuilder {
|
|
|
* @param config 策略配置
|
|
|
*/
|
|
|
private void processTypes(StrategyConfig config) {
|
|
|
- if (StringUtils.isEmpty(config.getSuperServiceClass())) {
|
|
|
+ if (StringUtils.isBlank(config.getSuperServiceClass())) {
|
|
|
superServiceClass = ConstVal.SUPER_SERVICE_CLASS;
|
|
|
} else {
|
|
|
superServiceClass = config.getSuperServiceClass();
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(config.getSuperServiceImplClass())) {
|
|
|
+ if (StringUtils.isBlank(config.getSuperServiceImplClass())) {
|
|
|
superServiceImplClass = ConstVal.SUPER_SERVICE_IMPL_CLASS;
|
|
|
} else {
|
|
|
superServiceImplClass = config.getSuperServiceImplClass();
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(config.getSuperMapperClass())) {
|
|
|
+ if (StringUtils.isBlank(config.getSuperMapperClass())) {
|
|
|
superMapperClass = ConstVal.SUPER_MAPPER_CLASS;
|
|
|
} else {
|
|
|
superMapperClass = config.getSuperMapperClass();
|
|
@@ -329,33 +329,33 @@ public class ConfigBuilder {
|
|
|
} else {
|
|
|
entityName = NamingStrategy.capitalFirst(processName(tableInfo.getName(), strategy, tablePrefix));
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(globalConfig.getEntityName())) {
|
|
|
+ if (StringUtils.isNotBlank(globalConfig.getEntityName())) {
|
|
|
tableInfo.setConvert(true);
|
|
|
tableInfo.setEntityName(String.format(globalConfig.getEntityName(), entityName));
|
|
|
} else {
|
|
|
tableInfo.setEntityName(strategyConfig, entityName);
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(globalConfig.getMapperName())) {
|
|
|
+ if (StringUtils.isNotBlank(globalConfig.getMapperName())) {
|
|
|
tableInfo.setMapperName(String.format(globalConfig.getMapperName(), entityName));
|
|
|
} else {
|
|
|
tableInfo.setMapperName(entityName + ConstVal.MAPPER);
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(globalConfig.getXmlName())) {
|
|
|
+ if (StringUtils.isNotBlank(globalConfig.getXmlName())) {
|
|
|
tableInfo.setXmlName(String.format(globalConfig.getXmlName(), entityName));
|
|
|
} else {
|
|
|
tableInfo.setXmlName(entityName + ConstVal.MAPPER);
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(globalConfig.getServiceName())) {
|
|
|
+ if (StringUtils.isNotBlank(globalConfig.getServiceName())) {
|
|
|
tableInfo.setServiceName(String.format(globalConfig.getServiceName(), entityName));
|
|
|
} else {
|
|
|
tableInfo.setServiceName("I" + entityName + ConstVal.SERVICE);
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(globalConfig.getServiceImplName())) {
|
|
|
+ if (StringUtils.isNotBlank(globalConfig.getServiceImplName())) {
|
|
|
tableInfo.setServiceImplName(String.format(globalConfig.getServiceImplName(), entityName));
|
|
|
} else {
|
|
|
tableInfo.setServiceImplName(entityName + ConstVal.SERVICE_IMPL);
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(globalConfig.getControllerName())) {
|
|
|
+ if (StringUtils.isNotBlank(globalConfig.getControllerName())) {
|
|
|
tableInfo.setControllerName(String.format(globalConfig.getControllerName(), entityName));
|
|
|
} else {
|
|
|
tableInfo.setControllerName(entityName + ConstVal.CONTROLLER);
|
|
@@ -372,7 +372,7 @@ public class ConfigBuilder {
|
|
|
* @param tableInfo ignore
|
|
|
*/
|
|
|
private void checkImportPackages(TableInfo tableInfo) {
|
|
|
- if (StringUtils.isNotEmpty(strategyConfig.getSuperEntityClass())) {
|
|
|
+ if (StringUtils.isNotBlank(strategyConfig.getSuperEntityClass())) {
|
|
|
// 自定义父类
|
|
|
tableInfo.getImportPackages().add(strategyConfig.getSuperEntityClass());
|
|
|
} else if (globalConfig.isActiveRecord()) {
|
|
@@ -384,7 +384,7 @@ public class ConfigBuilder {
|
|
|
tableInfo.getImportPackages().add(com.baomidou.mybatisplus.annotation.IdType.class.getCanonicalName());
|
|
|
tableInfo.getImportPackages().add(com.baomidou.mybatisplus.annotation.TableId.class.getCanonicalName());
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(strategyConfig.getVersionFieldName())
|
|
|
+ if (StringUtils.isNotBlank(strategyConfig.getVersionFieldName())
|
|
|
&& CollectionUtils.isNotEmpty(tableInfo.getFields())) {
|
|
|
tableInfo.getFields().forEach(f -> {
|
|
|
if (strategyConfig.getVersionFieldName().equals(f.getName())) {
|
|
@@ -470,7 +470,7 @@ public class ConfigBuilder {
|
|
|
ResultSet results = preparedStatement.executeQuery()) {
|
|
|
while (results.next()) {
|
|
|
String tableName = results.getString(dbQuery.tableName());
|
|
|
- if (StringUtils.isNotEmpty(tableName)) {
|
|
|
+ if (StringUtils.isNotBlank(tableName)) {
|
|
|
tableInfo = new TableInfo();
|
|
|
tableInfo.setName(tableName);
|
|
|
|
|
@@ -601,9 +601,9 @@ public class ConfigBuilder {
|
|
|
} else {
|
|
|
String key = results.getString(dbQuery.fieldKey());
|
|
|
if (DbType.DB2 == dbType || DbType.SQLITE == dbType) {
|
|
|
- isId = StringUtils.isNotEmpty(key) && "1".equals(key);
|
|
|
+ isId = StringUtils.isNotBlank(key) && "1".equals(key);
|
|
|
} else {
|
|
|
- isId = StringUtils.isNotEmpty(key) && "PRI".equals(key.toUpperCase());
|
|
|
+ isId = StringUtils.isNotBlank(key) && "PRI".equals(key.toUpperCase());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -671,7 +671,7 @@ public class ConfigBuilder {
|
|
|
* @return 连接后的路径
|
|
|
*/
|
|
|
private String joinPath(String parentDir, String packageName) {
|
|
|
- if (StringUtils.isEmpty(parentDir)) {
|
|
|
+ if (StringUtils.isBlank(parentDir)) {
|
|
|
parentDir = System.getProperty(ConstVal.JAVA_TMPDIR);
|
|
|
}
|
|
|
if (!StringUtils.endsWith(parentDir, File.separator)) {
|
|
@@ -690,7 +690,7 @@ public class ConfigBuilder {
|
|
|
* @return 连接后的包名
|
|
|
*/
|
|
|
private String joinPackage(String parent, String subPackage) {
|
|
|
- if (StringUtils.isEmpty(parent)) {
|
|
|
+ if (StringUtils.isBlank(parent)) {
|
|
|
return subPackage;
|
|
|
}
|
|
|
return parent + StringPool.DOT + subPackage;
|