我正在制作基于JPA / Eclipselink和实体的应用程序,并且删除操作必须是逻辑的(属性/列为true或false)才能在数据库中保留日志。我想知道是否有可能忽略数据库的行"删除"是"真"在关系OneToMany或ManyToMany。我有类似以下的实体:
@Entity
public class Employee {
@Id
@Column(name="EMP_ID")
private long id;
...
@OneToMany(mappedBy="owner")
private List<Phone> phones;
...
}
@Entity
public class Phone {
@Id
private long id;
@NotNull
@Column(name = "deleted")
private boolean deleted = false;
...
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="OWNER_ID")
private Employee owner;
...
}
提前致谢!
答案 0 :(得分:1)
是的,您可以将@AdditionalCriteria
用于此目的:
libboost_system.so.1.49.0 => /usr/lib/libboost_system.so.1.49.0
libboost_regex.so.1.49.0 => /usr/lib/libboost_regex.so.1.49.0
libboost_program_options.so.1.49.0 => /usr/lib/libboost_program_options.so.1.49.0
libboost_chrono.so.1.49.0 => /usr/lib/libboost_chrono.so.1.49.0