diff --git a/mybatis-plus-join-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/mybatis-plus-join-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..e1c3736 --- /dev/null +++ b/mybatis-plus-join-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.github.yulichang.autoconfigure.MybatisPlusJoinAutoConfiguration \ No newline at end of file diff --git a/mybatis-plus-join-core/src/main/java/com/baomidou/mybatisplus/core/metadata/MPJTableInfoHelper.java b/mybatis-plus-join-core/src/main/java/com/baomidou/mybatisplus/core/metadata/MPJTableInfoHelper.java index d938333..dedfe5a 100644 --- a/mybatis-plus-join-core/src/main/java/com/baomidou/mybatisplus/core/metadata/MPJTableInfoHelper.java +++ b/mybatis-plus-join-core/src/main/java/com/baomidou/mybatisplus/core/metadata/MPJTableInfoHelper.java @@ -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) { diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/MPJAbstractMethod.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/MPJAbstractMethod.java index ae810e2..d7d79ac 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/MPJAbstractMethod.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/MPJAbstractMethod.java @@ -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); } /** diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinList.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinList.java index b5a3e61..6bf39fb 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinList.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinList.java @@ -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") diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMap.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMap.java index a1af0f8..a2119ed 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMap.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMap.java @@ -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") diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMaps.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMaps.java index 7ce755c..0748e8d 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMaps.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMaps.java @@ -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") diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMapsPage.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMapsPage.java index 08bcb24..1c3214d 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMapsPage.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinMapsPage.java @@ -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") diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinOne.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinOne.java index 16a712b..38bbd31 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinOne.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinOne.java @@ -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") diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinPage.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinPage.java index ac3cdcf..4d14e10 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinPage.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/method/SelectJoinPage.java @@ -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")