确认

  • [X] 我的版本是最新版本, 我的版本号与 version 相同, 并且项目里无依赖冲突
  • [X] 我已经在 issue 中搜索过, 确认问题没有被提出过
  • [X] 我已经修改标题, 将标题中的 描述 替换为遇到的问题

功能改进

写法如下: wrapper.select(OrderLog.class, a -> !a.getColumn().equals("id")) v3.4.0 版本下可以select 除了 主键 id 之外的所有字段,升级为 v3.5.6 后就无法排除主键失效了,会select 包含主键 id 以及所有字段。 查看官方文档中出现如下说明: MyBatis-Plus [功能改进]: wrapper.select(Class<T> entityClass, Predicate<TableFieldInfo> predicate) 无法排除主键 我想说的是出于什么考虑才把主键过滤排除在外的?以及从什么版本开始改为这种情况的?以及能否恢复过滤主键 因为我在 releases 页面查看了 v3.4.0 -> v3.5.6 所有升级事项,没有找到相关改动的记录。

参考资料

No response

Comment From: miemieYaho

一直都这样,主键不是TableFieldInfo

Comment From: LouShangxiaolong

不是的,我可以很确定说的在 v3.4.0 版本是生效的

李小龙 楼上(深圳)科技有限公司
@. 楼上(深圳)科技有限公司 企业主页
「GOOD GOOD STUDY! DAY DAY UP!」
信息安全声明:本邮件包含信息归发件人所在组织所有,发件人所在组织对该邮件拥有所有权利。 请接收者注意保密,未经发件人书面许可,不得向任何第三方组织和个人透露本邮件所含信息的全部或部分。以上声明仅适用于工作邮件。 Information Security Notice: The information contained in this mail is solely property of the sender's organization. This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others. ------------------------------------------------------------------
@.> 日 期:2024年09月06日 18:58:52 @.> @.>; @.***> 主 题:Re: [baomidou/mybatis-plus] [功能改进]: wrapper.select(Class entityClass, Predicate predicate) 无法排除主键 (Issue #6465)

一直都这样,主键不是TableFieldInfo — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Comment From: miemieYaho

MyBatis-Plus [功能改进]: wrapper.select(Class<T> entityClass, Predicate<TableFieldInfo> predicate) 无法排除主键 MyBatis-Plus [功能改进]: wrapper.select(Class<T> entityClass, Predicate<TableFieldInfo> predicate) 无法排除主键

Comment From: LouShangxiaolong

🤔 下周我单独跑个3.4.0的demo重新试试

李小龙 楼上(深圳)科技有限公司
@. 楼上(深圳)科技有限公司 企业主页
「GOOD GOOD STUDY! DAY DAY UP!」
信息安全声明:本邮件包含信息归发件人所在组织所有,发件人所在组织对该邮件拥有所有权利。 请接收者注意保密,未经发件人书面许可,不得向任何第三方组织和个人透露本邮件所含信息的全部或部分。以上声明仅适用于工作邮件。 Information Security Notice: The information contained in this mail is solely property of the sender's organization. This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others. ------------------------------------------------------------------
@.> 日 期:2024年09月06日 19:07:55 @.> @.>; @.***> 主 题:Re: [baomidou/mybatis-plus] [功能改进]: wrapper.select(Class entityClass, Predicate predicate) 无法排除主键 (Issue #6465)

image.png (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Comment From: LouShangxiaolong

哦,发现问了,不是select的问题。是3.4.0 以及之前的版本 在执行saveBatch 时会自动 忽略掉 自增主键,使用新的自增id。 MyBatis-Plus [功能改进]: wrapper.select(Class<T> entityClass, Predicate<TableFieldInfo> predicate) 无法排除主键

切换到3.5.6 会把原来的 id 带上,导致了 id 重复。 MyBatis-Plus [功能改进]: wrapper.select(Class<T> entityClass, Predicate<TableFieldInfo> predicate) 无法排除主键 但是具体时哪个版本开始改变的就没试了;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("s_order_log")
public class OrderLog implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 订单id
     */
    private String orderId;
    /**
     * 操作类型
     */
    private String operationType;
    /**
     * 操作备注
     */
    private String remark;
    /**
     * 主状态
     */
    private Integer hostStatus;
    /**
     * 子状态
     */
    private Integer childStatus;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
}

Comment From: miemieYaho

MyBatis-Plus [功能改进]: wrapper.select(Class<T> entityClass, Predicate<TableFieldInfo> predicate) 无法排除主键

Comment From: LouShangxiaolong

好的。感谢