Skip to content

Commit

Permalink
移除过时的GlobalConfig.DbConfig#selectStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
miemieYaho committed Jan 23, 2025
1 parent 1f75f27 commit 033fdc9
Showing 1 changed file with 2 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.handlers.AnnotationHandler;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.baomidou.mybatisplus.core.handlers.PostInitTableInfoHandler;
Expand Down Expand Up @@ -85,7 +84,8 @@ public class GlobalConfig implements Serializable {
/**
* 注解控制器
*/
private AnnotationHandler annotationHandler = new AnnotationHandler(){};
private AnnotationHandler annotationHandler = new AnnotationHandler() {
};
/**
* 参与 TableInfo 的初始化
*/
Expand Down Expand Up @@ -198,43 +198,19 @@ public static class DbConfig {
* @since 3.1.2
*/
private FieldStrategy updateStrategy = FieldStrategy.NOT_NULL;

/**
* 字段验证策略之 select
*
* @since 3.1.2
* @deprecated 3.4.4
*/
@Deprecated
private FieldStrategy selectStrategy;

/**
* 字段验证策略之 where
* 替代selectStrategy,保持与{@link TableField#whereStrategy()}一致
*
* @since 3.4.4
*/
private FieldStrategy whereStrategy = FieldStrategy.NOT_NULL;

/**
* 生成INSERT语句时忽略自增主键字段(默认不忽略,主键有值时写入主键值,无值自增).
* <p>当设置为true时,执行生成SQL语句无论ID是否有值都会忽视 (此为3.4.3.1版本下策略,如果升级遇到问题可以考虑开启此配置来兼容升级)</p>
*
* @since 3.5.6
*/
private boolean insertIgnoreAutoIncrementColumn = false;

/**
* 重写whereStrategy的get方法,适配低版本:
* - 如果用户自定义了selectStrategy则用用户自定义的,
* - 后续版本移除selectStrategy后,直接删除该方法即可。
*
* @return 字段作为查询条件时的验证策略
* @since 3.4.4
*/
public FieldStrategy getWhereStrategy() {
return selectStrategy == null ? whereStrategy : selectStrategy;
}
}

/**
Expand Down

0 comments on commit 033fdc9

Please sign in to comment.