针对下划线转驼峰添加数字支持。

This commit is contained in:
makejava 2018-11-01 09:47:37 +08:00
parent 534420b33b
commit 46e1bf8fbd
2 changed files with 6 additions and 3 deletions

View File

@ -172,8 +172,11 @@ public class TableInfoServiceImpl implements TableInfoService {
if (configColumn.getType() == null) {
configColumn.setType(column.getType());
}
// 短类型
configColumn.setShortType(nameUtils.getClsNameByFullName(configColumn.getType()));
if (!StringUtils.isEmpty(configColumn.getType())) {
// 短类型
configColumn.setShortType(nameUtils.getClsNameByFullName(configColumn.getType()));
}
// 表注释覆盖
if (configColumn.getComment() == null) {
configColumn.setComment(column.getComment());
}

View File

@ -38,7 +38,7 @@ public class NameUtils {
/**
* 转驼峰命名正则匹配规则
*/
private final Pattern TO_HUMP_PATTERN = Pattern.compile("[-_]([a-z])");
private final Pattern TO_HUMP_PATTERN = Pattern.compile("[-_]([a-z0-9])");
/**
* 首字母大写方法