修复编译器无法识别bean问题,新增实体类表名注解异常报错
This commit is contained in:
@@ -3,6 +3,7 @@ package com.common.base.common.utils;
|
||||
|
||||
import com.common.base.common.ServiceException;
|
||||
import com.common.base.module.data.annotation.DataIgnore;
|
||||
import com.common.base.module.data.exception.BaseMapperException;
|
||||
import com.common.base.module.data.module.DataMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -76,6 +77,9 @@ public class ObjectUtil {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
if (clazz.getAnnotation(Table.class) != null) {
|
||||
Table table = clazz.getAnnotation(Table.class);
|
||||
if (StringUtils.isEmpty(table.name())) {
|
||||
throw new BaseMapperException("请检查实体类是否添加注解@Table,并且name中是否正确设置了表名");
|
||||
}
|
||||
dataMap = dataMap.tableName(table.name());
|
||||
}
|
||||
for (Field field : clazz.getDeclaredFields()) {
|
||||
|
||||
@@ -19,12 +19,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Qualifier("base")
|
||||
@Service("base")
|
||||
public class BaseMapperImpl implements BaseMapper {
|
||||
|
||||
|
||||
|
||||
public static final String BASE = "base";
|
||||
|
||||
final TableMapper tableMapper;
|
||||
@@ -598,4 +595,7 @@ public class BaseMapperImpl implements BaseMapper {
|
||||
}
|
||||
return Long.parseLong(id.toString())+1L;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.common.base.common.utils.XssClass;
|
||||
import com.common.base.common.utils.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user