diff --git a/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/Id.java b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/Id.java index e2903231..4002046f 100644 --- a/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/Id.java +++ b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/Id.java @@ -15,8 +15,6 @@ */ package com.mybatisflex.annotation; -import com.mybatisflex.core.enums.KeyType; - import java.lang.annotation.*; @Inherited diff --git a/mybatis-flex-annotation/src/main/java/com/mybatisflex/core/enums/KeyType.java b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/KeyType.java similarity index 96% rename from mybatis-flex-annotation/src/main/java/com/mybatisflex/core/enums/KeyType.java rename to mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/KeyType.java index 09ab71b4..d26fa7b2 100644 --- a/mybatis-flex-annotation/src/main/java/com/mybatisflex/core/enums/KeyType.java +++ b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/KeyType.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.mybatisflex.core.enums; +package com.mybatisflex.annotation; /** * ID 生成策略 diff --git a/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/Table.java b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/Table.java index 2adb1e2e..9735cc75 100644 --- a/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/Table.java +++ b/mybatis-flex-annotation/src/main/java/com/mybatisflex/annotation/Table.java @@ -32,11 +32,6 @@ public @interface Table { */ String schema() default ""; - /** - * 是否使用 mybatis 缓存 - */ - boolean useCached() default false; - /** * 默认为 驼峰属性 转换为 下划线字段 */ diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/FlexGlobalConfig.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/FlexGlobalConfig.java index 181ae11d..6527b714 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/FlexGlobalConfig.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/FlexGlobalConfig.java @@ -16,7 +16,7 @@ package com.mybatisflex.core; import com.mybatisflex.core.dialect.DbType; -import com.mybatisflex.core.enums.KeyType; +import com.mybatisflex.annotation.KeyType; import org.apache.ibatis.session.Configuration; import org.apache.ibatis.session.SqlSessionFactory; diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/CustomKeyGenerator.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/CustomKeyGenerator.java index 11014e55..6d2aba22 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/CustomKeyGenerator.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/CustomKeyGenerator.java @@ -15,6 +15,7 @@ */ package com.mybatisflex.core.key; +import com.mybatisflex.annotation.KeyType; import com.mybatisflex.core.FlexConsts; import com.mybatisflex.core.FlexGlobalConfig; import com.mybatisflex.core.exception.FlexExceptions; @@ -33,7 +34,7 @@ import java.util.Map; /** * 通过 java 编码的方式生成主键 * 当主键类型配置为 KeyType#Generator 时,使用此生成器生成 - * {@link com.mybatisflex.core.enums.KeyType#Generator} + * {@link KeyType#Generator} */ public class CustomKeyGenerator implements KeyGenerator { diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/MybatisKeyGeneratorUtil.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/MybatisKeyGeneratorUtil.java index 0c8fcc07..0a07140c 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/MybatisKeyGeneratorUtil.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/MybatisKeyGeneratorUtil.java @@ -17,7 +17,7 @@ package com.mybatisflex.core.key; import com.mybatisflex.core.FlexConsts; import com.mybatisflex.core.FlexGlobalConfig; -import com.mybatisflex.core.enums.KeyType; +import com.mybatisflex.annotation.KeyType; import com.mybatisflex.core.exception.FlexExceptions; import com.mybatisflex.core.table.IdInfo; import com.mybatisflex.core.table.TableInfo; diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/RowCustomKeyGenerator.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/RowCustomKeyGenerator.java index f62afe4a..b1757d58 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/RowCustomKeyGenerator.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/RowCustomKeyGenerator.java @@ -15,6 +15,7 @@ */ package com.mybatisflex.core.key; +import com.mybatisflex.annotation.KeyType; import com.mybatisflex.core.FlexConsts; import com.mybatisflex.core.exception.FlexExceptions; import com.mybatisflex.core.row.Row; @@ -29,7 +30,7 @@ import java.util.Map; /** * 通过 java 编码的方式生成主键 * 当主键类型配置为 KeyType#Generator 时,使用此生成器生成 - * {@link com.mybatisflex.core.enums.KeyType#Generator} + * {@link KeyType#Generator} */ public class RowCustomKeyGenerator implements KeyGenerator { diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/RowKeyGenerator.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/RowKeyGenerator.java index b44d48bc..30e7cc48 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/RowKeyGenerator.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/key/RowKeyGenerator.java @@ -16,7 +16,7 @@ package com.mybatisflex.core.key; import com.mybatisflex.core.FlexConsts; -import com.mybatisflex.core.enums.KeyType; +import com.mybatisflex.annotation.KeyType; import com.mybatisflex.core.row.Row; import com.mybatisflex.core.row.RowKey; import com.mybatisflex.core.util.ArrayUtil; diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexConfiguration.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexConfiguration.java index 6835b00d..97b6d148 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexConfiguration.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexConfiguration.java @@ -47,12 +47,10 @@ public class FlexConfiguration extends Configuration { public FlexConfiguration(Environment environment) { super(environment); setMapUnderscoreToCamelCase(true); -// setLogImpl(StdOutImpl.class); initDefaultMappers(); } public FlexConfiguration() { -// setLogImpl(StdOutImpl.class); initDefaultMappers(); } @@ -93,7 +91,6 @@ public class FlexConfiguration extends Configuration { } - @Override public void addMappedStatement(MappedStatement ms) { //替换 RowMapper.insertRow 的主键生成器 diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/RowKey.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/RowKey.java index a9427f12..21b01fca 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/RowKey.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/RowKey.java @@ -15,7 +15,7 @@ */ package com.mybatisflex.core.row; -import com.mybatisflex.core.enums.KeyType; +import com.mybatisflex.annotation.KeyType; import com.mybatisflex.core.util.SqlUtil; /** diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/IdInfo.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/IdInfo.java index 8232ce00..78b3cf44 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/IdInfo.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/IdInfo.java @@ -16,7 +16,7 @@ package com.mybatisflex.core.table; import com.mybatisflex.annotation.Id; -import com.mybatisflex.core.enums.KeyType; +import com.mybatisflex.annotation.KeyType; public class IdInfo extends ColumnInfo { diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfo.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfo.java index f36a54db..9e270242 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfo.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfo.java @@ -16,7 +16,7 @@ package com.mybatisflex.core.table; import com.mybatisflex.core.FlexConsts; -import com.mybatisflex.core.enums.KeyType; +import com.mybatisflex.annotation.KeyType; import com.mybatisflex.core.javassist.ModifyAttrsRecord; import com.mybatisflex.core.row.Row; import com.mybatisflex.core.util.ArrayUtil; @@ -38,7 +38,6 @@ public class TableInfo { private String schema; //schema private String tableName; //表名 private Class entityClass; //实体类 - private boolean useCached = false; private boolean camelToUnderline = true; //逻辑删除数据库列名 @@ -105,14 +104,6 @@ public class TableInfo { this.entityClass = entityClass; } - public boolean isUseCached() { - return useCached; - } - - public void setUseCached(boolean useCached) { - this.useCached = useCached; - } - public boolean isCamelToUnderline() { return camelToUnderline; } diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfos.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfos.java index 8371f2be..1c9da731 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfos.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfos.java @@ -95,7 +95,6 @@ public class TableInfos { if (table != null) { tableInfo.setTableName(table.value()); tableInfo.setSchema(table.schema()); - tableInfo.setUseCached(table.useCached()); tableInfo.setCamelToUnderline(table.camelToUnderline()); } else { //默认为类名转驼峰下划线 diff --git a/mybatis-flex-core/src/test/java/com/mybatisflex/test/Article.java b/mybatis-flex-core/src/test/java/com/mybatisflex/test/Article.java index d0d68806..73858f6f 100644 --- a/mybatis-flex-core/src/test/java/com/mybatisflex/test/Article.java +++ b/mybatis-flex-core/src/test/java/com/mybatisflex/test/Article.java @@ -3,7 +3,7 @@ package com.mybatisflex.test; import com.mybatisflex.annotation.Column; import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Table; -import com.mybatisflex.core.enums.KeyType; +import com.mybatisflex.annotation.KeyType; import java.util.Date; diff --git a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java index fa78d964..2cb9d35d 100644 --- a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java +++ b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java @@ -2,7 +2,7 @@ package com.mybatisflex.test; import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Table; -import com.mybatisflex.core.enums.KeyType; +import com.mybatisflex.annotation.KeyType; import java.util.Date; diff --git a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/model/Account.java b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/model/Account.java index f9cc237e..a98d14e1 100644 --- a/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/model/Account.java +++ b/mybatis-flex-test/mybatis-flex-spring-boot-test/src/main/java/com/mybatisflex/test/model/Account.java @@ -17,7 +17,7 @@ package com.mybatisflex.test.model; import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Table; -import com.mybatisflex.core.enums.KeyType; +import com.mybatisflex.annotation.KeyType; import java.util.Date;