fix on 配置问题

This commit is contained in:
yulichang 2024-01-18 13:25:48 +08:00
parent fe3e139826
commit 0db41de3da

View File

@ -56,8 +56,8 @@ public class XPluginImpl implements Plugin {
ConfigProperties.tableAlias = prop.get("tableAlias", Function.identity()); ConfigProperties.tableAlias = prop.get("tableAlias", Function.identity());
ConfigProperties.joinPrefix = prop.get("joinPrefix", Function.identity()); ConfigProperties.joinPrefix = prop.get("joinPrefix", Function.identity());
ConfigProperties.logicDelType = prop.get("logicDelType", val -> ConfigProperties.logicDelType = prop.get("logicDelType", val ->
Arrays.stream(LogicDelTypeEnum.values()).filter(e -> e.name().equalsIgnoreCase(val)).findFirst() // fix on/off yes/no 会转为Boolean
.orElseThrow(() -> ExceptionUtils.mpe("mybatis-plus-join.logicDelType 配置错误"))); LogicDelTypeEnum.WHERE.name().equalsIgnoreCase(val) ? LogicDelTypeEnum.WHERE : LogicDelTypeEnum.ON);
ConfigProperties.mappingMaxCount = prop.get("mappingMaxCount", Integer::parseInt); ConfigProperties.mappingMaxCount = prop.get("mappingMaxCount", Integer::parseInt);
ConfigProperties.ifExists = prop.get("ifExists", val -> ConfigProperties.ifExists = prop.get("ifExists", val ->
Arrays.stream(IfExistsEnum.values()).filter(e -> e.name().equalsIgnoreCase(val)).findFirst() Arrays.stream(IfExistsEnum.values()).filter(e -> e.name().equalsIgnoreCase(val)).findFirst()
@ -78,8 +78,8 @@ public class XPluginImpl implements Plugin {
public Prop(Props props) { public Prop(Props props) {
this.props = props.entrySet().stream().filter(e -> format(e.getKey()) this.props = props.entrySet().stream().filter(e -> format(e.getKey())
.startsWith(format("mybatis-plus-join."))).collect(Collectors.toMap(e -> e.getKey().toString() .startsWith(format("mybatis-plus-join."))).collect(Collectors.toMap(e -> format(e.getKey())
.substring(e.getKey().toString().lastIndexOf(".") + 1) .substring(e.getKey().toString().indexOf(".") + 1)
.toUpperCase(Locale.ENGLISH), Map.Entry::getValue, (o, n) -> n, Properties::new)); .toUpperCase(Locale.ENGLISH), Map.Entry::getValue, (o, n) -> n, Properties::new));
} }