我试图在我的一个实体类中使用@Formula。我需要做的是从另一个实体中选择一个布尔值。
我试图放置属性定义,但它在发布时不断抛出 NullPointerException,我这样做如下
@JoinColumn(name = "SOIR08_FECHA_CARGA", referencedColumnName = "SOIR15_CODI_FECHA", nullable = true)
@ManyToOne(fetch = FetchType.EAGER)
private FechaCarga loadDate;
@JoinColumn(name = "SOIR08_RECEPTOR", referencedColumnName = "SOIR05_CON_DISTRITO_TELEFONICO", nullable = true)
@ManyToOne(optional = true, fetch = FetchType.EAGER)
private DistrictPhone receiver;
@Formula("(select io.done from Table io where io.district = receiver and io.loadDate = loadDate)")
private Boolean isDone;
然后我尝试将@Formula注释放在getter中
@Formula("(select io.done from Table io where io.district = receiver and io.loadDate = loadDate))")
public Boolean getIsDone() {
return isDone;
}
但是当我访问必须显示属性的页面时,我得到ORA-00904: "APROB0_"."ISDONE": invalid identifier
任何想法、建议或解决方法都将受到高度赞赏。