前言
这里介绍@Where注解给Entity统一添加条件查询。
具体实现
- Product.java
@Entity
@Getter
@Setter
@Where(clause = "delete_time is null")
public class Product {
@Id
private int id;
private String title;
private Date createTime;
private Date deleteTime;
}
- 实现效果