我有一个带有 Hibernate 注释的 Java 类,它引用了另一个 POJO:
@Entity
@Table(name = "Patient_Visit_Transaction")
public class PatientVisitTransaction extends Bean {
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "transaction_id")
List<TransactionNoteDW> notes;
....
}
另一个类是这样的:
@Entity
@Table(name = "Transaction_note_dw")
public class TransactionNoteDW extends DateAuditableBean {
@Id
@Column(name = "note_seq")
private long id;
@Column(name = "transaction_id")
private String transactionId;
}
我正在尝试删除 aPatientVisitTransaction
并收到错误消息:
mappedBy reference an unknown target entity property: TransactionNoteDW.transaction_id in PatientVisitTransaction.notes
.
我猜它正在尝试映射notes
到transaction_id
. 我如何指定正确的映射,或者我是否完全偏离了我的评估?