mybatis plus 3.5.3 测试以及 springboot3适配

This commit is contained in:
yulichang 2022-12-29 16:35:27 +08:00
parent 5d109b0aa1
commit 52c33a907a
9 changed files with 22 additions and 9 deletions

View File

@ -0,0 +1 @@
com.github.yulichang.autoconfigure.MybatisPlusJoinAutoConfiguration

View File

@ -6,6 +6,7 @@ import com.github.yulichang.annotation.EntityMapping;
import com.github.yulichang.annotation.FieldMapping;
import com.github.yulichang.exception.MPJException;
import com.github.yulichang.mapper.MPJTableInfo;
import org.apache.ibatis.session.Configuration;
import java.lang.reflect.Field;
import java.util.ArrayList;
@ -129,7 +130,12 @@ public class MPJTableInfoHelper {
*/
public static TableInfo copyAndSetTableName(TableInfo tableInfo, String tableName) {
try {
TableInfo table = new TableInfo(tableInfo.getEntityType());
TableInfo table;
try {
table = TableInfo.class.getDeclaredConstructor(Class.class).newInstance(tableInfo.getEntityType());
} catch (Exception e) {
table = TableInfo.class.getDeclaredConstructor(Configuration.class, Class.class).newInstance(tableInfo.getConfiguration(), tableInfo.getEntityType());
}
//反射拷贝对象
Field[] fields = TableInfo.class.getDeclaredFields();
for (Field f : fields) {

View File

@ -22,9 +22,9 @@ public abstract class MPJAbstractMethod extends AbstractMethod implements MPJBas
super();
}
@SuppressWarnings({"unused", "deprecation"})
@SuppressWarnings({"unused"})
protected MPJAbstractMethod(String methodName) {
super();
super(methodName);
}
/**

View File

@ -11,8 +11,9 @@ import org.apache.ibatis.mapping.SqlSource;
*/
public class SelectJoinList extends MPJAbstractMethod {
@SuppressWarnings("deprecation")
public SelectJoinList() {
super(SqlMethod.SELECT_JOIN_LIST.getMethod());
super();
}
@SuppressWarnings("unused")

View File

@ -13,8 +13,9 @@ import java.util.Map;
*/
public class SelectJoinMap extends MPJAbstractMethod {
@SuppressWarnings("deprecation")
public SelectJoinMap() {
super(SqlMethod.SELECT_JOIN_LIST.getMethod());
super();
}
@SuppressWarnings("unused")

View File

@ -13,8 +13,9 @@ import java.util.Map;
*/
public class SelectJoinMaps extends MPJAbstractMethod {
@SuppressWarnings("deprecation")
public SelectJoinMaps() {
super(SqlMethod.SELECT_JOIN_MAPS.getMethod());
super();
}
@SuppressWarnings("unused")

View File

@ -13,8 +13,9 @@ import java.util.Map;
*/
public class SelectJoinMapsPage extends MPJAbstractMethod {
@SuppressWarnings("deprecation")
public SelectJoinMapsPage() {
super(SqlMethod.SELECT_JOIN_MAPS_PAGE.getMethod());
super();
}
@SuppressWarnings("unused")

View File

@ -11,8 +11,9 @@ import org.apache.ibatis.mapping.SqlSource;
*/
public class SelectJoinOne extends MPJAbstractMethod {
@SuppressWarnings("deprecation")
public SelectJoinOne() {
super(SqlMethod.SELECT_JOIN_ONE.getMethod());
super();
}
@SuppressWarnings("unused")

View File

@ -11,8 +11,9 @@ import org.apache.ibatis.mapping.SqlSource;
*/
public class SelectJoinPage extends MPJAbstractMethod {
@SuppressWarnings("deprecation")
public SelectJoinPage() {
super(SqlMethod.SELECT_JOIN_PAGE.getMethod());
super();
}
@SuppressWarnings("unused")