mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
修改getPropertySimpleType方法实现,不再使用Class.forName(str), 防止出现找不到类的问题。
This commit is contained in:
parent
91e503ba74
commit
3247658ded
@ -99,17 +99,13 @@ public class Column {
|
||||
}
|
||||
|
||||
public String getPropertySimpleType() {
|
||||
try {
|
||||
if (columnConfig.getPropertyType() != null) {
|
||||
if (!columnConfig.getPropertyType().contains(".")) {
|
||||
return columnConfig.getPropertyType();
|
||||
}
|
||||
return Class.forName(columnConfig.getPropertyType()).getSimpleName();
|
||||
} else {
|
||||
return propertyType.substring(propertyType.lastIndexOf(".") + 1);
|
||||
if (columnConfig.getPropertyType() != null) {
|
||||
if (!columnConfig.getPropertyType().contains(".")) {
|
||||
return columnConfig.getPropertyType();
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException(e);
|
||||
return StringUtil.substringAfterLast(columnConfig.getPropertyType(), ".");
|
||||
} else {
|
||||
return StringUtil.substringAfterLast(propertyType, ".");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -287,5 +287,15 @@ public class StringUtil {
|
||||
return string != null ? string.trim() : null;
|
||||
}
|
||||
|
||||
public static String substringAfterLast(String text, String str) {
|
||||
if (text == null) {
|
||||
return null;
|
||||
}
|
||||
if (str == null) {
|
||||
return text;
|
||||
}
|
||||
return text.substring(text.lastIndexOf(str) + 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user