加入成員變量名稱來生成的SQL用於joinColumn我有這些表的實體:休眠上SecondaryTable
@Entity
@Table(name = "PM_ADJ_MULTI_YR_DETAILS")
@SecondaryTables(
{
@SecondaryTable(name = "PM_RPT_MASTER", pkJoinColumns = @PrimaryKeyJoinColumn(name = "INCTV_APP_SAK")),
@SecondaryTable(name = "PM_INCTV_APP", pkJoinColumns = @PrimaryKeyJoinColumn(name = "INCTV_APP_SAK")),
@SecondaryTable(name = "PM_ADJ_MULTI_YR", pkJoinColumns = @PrimaryKeyJoinColumn(name = "MULTI_YR_ADJ_SAK"))
}
)
在此實體我有一個成員變量如下:
@ManyToOne
@JoinColumn(name = "MMIS4_IND", table = "PM_ADJ_MULTI_YR")
private MultiYrAdjMmis4Ind mmis4Ind;
休眠在添加成員變量名稱來生成的SQL如下:
AND t1.MMIS4IND_MMIS4_IND = t4.MMIS4_IND(+)
這應該是:
AND t1.MMIS4_IND = t4.MMIS4_IND(+)
我們使用的是javax.persistence-2.0.0.jar和Spring 3.0.2。