mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 07:41:53 +08:00
!112 修复代码生成器遇到无符号类型数据库类型时无法匹配到 javaType
Merge pull request !112 from wanwan/fix-codegen-unsigned-20220327
This commit is contained in:
commit
172b227f90
@ -160,8 +160,9 @@ public class CodegenBuilder {
|
||||
// 处理 javaField 字段
|
||||
column.setJavaField(toCamelCase(column.getColumnName()));
|
||||
// 处理 dictType 字段,暂无
|
||||
// 处理 javaType 字段
|
||||
String dbType = subBefore(column.getColumnType(), '(', false);
|
||||
// 处理 javaType 字段(兼容无符号类型)
|
||||
String dbType = replaceIgnoreCase(subBefore(column.getColumnType(), '(', false),
|
||||
" UNSIGNED", "");
|
||||
javaTypeMappings.entrySet().stream()
|
||||
.filter(entry -> entry.getValue().contains(dbType))
|
||||
.findFirst().ifPresent(entry -> column.setJavaType(entry.getKey()));
|
||||
|
Loading…
Reference in New Issue
Block a user