Code:
@Etity
public class Person {
@Id
private String personId;
@Embedded
private CommonInfo commonInfo;
....
}
@Embeddable
public class CommonInfo {
@Column(insertable=false)
@ColumnDefault("0")
@Generated(GenerationTime.INSERT)
private boolean onDelete;
@Column(insertable=false
, updatable=false)
@Generated(GenerationTime.INSERT)
@ColumnDefault("CURRENT_TIMESTAMP")
private LocalDateTime createTime;
@Column(insertable=false)
@ColumnDefault("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
@Generated(GenerationTime.ALWAYS)
private LocalDateTime updateTime;
......
}
With
CriteriaBuilder builder
, CriteriaQuery<Person> query
, Root<Person> root , how to build a Predicate that onDelete equals false?
If available, can it be built by
Metadata Model?