v1.0.0 prepare

This commit is contained in:
开源海哥 2023-03-12 14:26:11 +08:00
parent d43768d77e
commit 418313872f
16 changed files with 14 additions and 32 deletions

View File

@ -15,8 +15,6 @@
*/
package com.mybatisflex.annotation;
import com.mybatisflex.core.enums.KeyType;
import java.lang.annotation.*;
@Inherited

View File

@ -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 生成策略

View File

@ -32,11 +32,6 @@ public @interface Table {
*/
String schema() default "";
/**
* 是否使用 mybatis 缓存
*/
boolean useCached() default false;
/**
* 默认为 驼峰属性 转换为 下划线字段
*/

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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 的主键生成器

View File

@ -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;
/**

View File

@ -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 {

View File

@ -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;
}

View File

@ -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 {
//默认为类名转驼峰下划线

View File

@ -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;

View File

@ -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;

View File

@ -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;