mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
错误提示
This commit is contained in:
parent
09e8037ff1
commit
f558466fb2
@ -33,7 +33,7 @@ public class LogicInfoUtils implements Constants {
|
||||
private static String getLogicStr(String tableIndex, Class<?> clazz) {
|
||||
String logicStr;
|
||||
TableInfo tableInfo = TableInfoHelper.getTableInfo(clazz);
|
||||
Assert.notNull(tableInfo, "%s 不是数据库实体或没有注册到mybatis plus中", clazz.getName());
|
||||
Assert.notNull(tableInfo, "table not find by class <%s>", clazz.getSimpleName());
|
||||
if (tableInfo.isWithLogicDelete() && Objects.nonNull(tableInfo.getLogicDeleteFieldInfo())) {
|
||||
final String value = tableInfo.getLogicDeleteFieldInfo().getLogicNotDeleteValue();
|
||||
if (NULL.equalsIgnoreCase(value)) {
|
||||
|
@ -2,11 +2,9 @@ package com.github.yulichang.wrapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.SharedString;
|
||||
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.*;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.github.yulichang.config.ConfigProperties;
|
||||
import com.github.yulichang.toolkit.Constant;
|
||||
@ -202,7 +200,9 @@ public class MPJLambdaWrapper<T> extends MPJAbstractLambdaWrapper<T, MPJLambdaWr
|
||||
if (StringUtils.isBlank(from.getStringValue())) {
|
||||
StringBuilder value = new StringBuilder();
|
||||
for (MPJLambdaWrapper<?> wrapper : onWrappers) {
|
||||
String tableName = TableInfoHelper.getTableInfo(wrapper.getJoinClass()).getTableName();
|
||||
TableInfo info = TableInfoHelper.getTableInfo(wrapper.getJoinClass());
|
||||
Assert.notNull(info, "table not find by class <%s>", wrapper.getJoinClass().getSimpleName());
|
||||
String tableName = info.getTableName();
|
||||
value.append(StringPool.SPACE)
|
||||
.append(wrapper.getKeyWord())
|
||||
.append(StringPool.SPACE)
|
||||
|
@ -3,6 +3,7 @@ package com.github.yulichang.wrapper.interfaces;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableFieldInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.github.yulichang.toolkit.LambdaUtils;
|
||||
import com.github.yulichang.toolkit.MPJReflectionKit;
|
||||
@ -48,6 +49,7 @@ public interface Query<Children> extends Serializable {
|
||||
*/
|
||||
default <E> Children select(Class<E> entityClass, Predicate<TableFieldInfo> predicate) {
|
||||
TableInfo info = TableInfoHelper.getTableInfo(entityClass);
|
||||
Assert.notNull(info, "table not find by class <%s>", entityClass.getSimpleName());
|
||||
Map<String, SelectCache> cacheMap = ColumnCache.getMapField(entityClass);
|
||||
info.getFieldList().stream().filter(predicate).collect(Collectors.toList()).forEach(
|
||||
i -> getSelectColum().add(new SelectNormal(cacheMap.get(i.getProperty()), getIndex())));
|
||||
|
@ -212,6 +212,7 @@ public class MybatisLabel<E, T> {
|
||||
|
||||
private void autoBuild(boolean auto, Class<E> entityClass, Class<T> tagClass) {
|
||||
TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass);
|
||||
Assert.notNull(tableInfo, "table not find by class <%s>", entityClass.getSimpleName());
|
||||
Map<String, Field> tagMap = MPJReflectionKit.getFieldMap(tagClass);
|
||||
if (auto && !tagMap.isEmpty()) {
|
||||
List<SelectCache> listField = ColumnCache.getListField(entityClass);
|
||||
|
Loading…
x
Reference in New Issue
Block a user