최대 절전 모드로 일식 링크에서 마이그레이션하는 고객을위한 @MappedSuperclass 법인에서 시행되지 않고,이 BaseEntity
을 확장하는 모든 기관에서 논리적으로 삭제 된 레코드를 필터링, @MappedSupperClass
BaseEntity
수준에서 최대 절전 모드에서 일식 링크 주석 @AdditionalCriteria
에 해당 찾고 있어요 .최대 절전 모드 @Where이
나는 @Where
주석을 발견했습니다. 그러나 이것은 Entity
레벨에서만 작동하며 BaseEntity에서는 작동하지 않습니다. 이 매크로 나 다른 Hibernate 주석을 필터 BaseEntity
에 추가 할 가능성이 있는지 알려 주시기 바랍니다.
@MappedSuperclass
@Where(clause = "DEL_IND = 0") // DOES NOT WORK
public abstract class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name = "DEL_IND")
private boolean deleted = Boolean.FALSE;
public boolean getDeleted() {
return deleted;
}
public void setDeleted() {
this.deleted = Boolean.TRUE;
}
}
@Entity
@Table(name = "PERSON")
@Where(clause = "DEL_IND = 0") // THIS WORKS BUT NEEDS TO BE REPEATED IN ALL ENTITIES
public class Person extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@Column(name = "PERSON_ID")
private Integer id;
@Column(name = "LAST_NAME")
private String lastName;
@Column(name = "FIRST_NAME")
private String firstName;
--------------------
getters & setters
--------------------
--------------------
}