gpt4 book ai didi

java - @Where(clause = "DELETE_FLAG=' N'") 在基类中不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 10:47:15 25 4
gpt4 key购买 nike

@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@Where(clause = "DELETE_FLAG='N'") //enable delete flag global //TODO:????why not work!
public abstract class AuditedEntity extends BaseEntity {

@CreatedBy
private String createUserId;
@CreatedDate
private Date createTime;
@LastModifiedBy
private String lastModifyUserId;
@LastModifiedDate
private Date lastModifyTime;

private String deleteFlag;
}
@Entity
@Data
@Table(name = "SYS_CATEGORY")
public class SysCategoryEntity extends AuditedEntity {
}

这是完整的代码。当我在 SysCategoryEntity 上添加 @Where(clause = "DELETE_FLAG='N'") 时,它就起作用了。

最佳答案

这似乎是一个 Hibernate Bug,请参阅 HHH-8873

关于java - @Where(clause = "DELETE_FLAG=' N'") 在基类中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48259501/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com