fixed: 修复 createIdKeyGenerator 提示错误的问题

This commit is contained in:
开源海哥 2023-04-26 16:59:10 +08:00
parent 73bc5e0ec5
commit 7f19e4c6bb

View File

@ -57,7 +57,7 @@ public class MybatisKeyGeneratorUtil {
FlexGlobalConfig.KeyConfig globalKeyConfig = FlexGlobalConfig.getConfig(ms.getConfiguration()).getKeyConfig();
KeyType keyType = getKeyType(idInfo, globalKeyConfig);
if (keyType == KeyType.None) {
if (keyType == null || keyType == KeyType.None) {
return NoKeyGenerator.INSTANCE;
}
@ -74,7 +74,7 @@ public class MybatisKeyGeneratorUtil {
//通过序列生成的注解
String sequence = getKeyValue(idInfo, globalKeyConfig);
if (StringUtil.isBlank(sequence)) {
throw FlexExceptions.wrap("please config @Id(value=\"...\") for field: %s in class: %s"
throw FlexExceptions.wrap("Please config sequence by @Id(value=\"...\") for field: %s in class: %s"
, idInfo.getProperty()
, tableInfo.getEntityClass().getName());
}