Hibernate中有两个外键列的多列

时间:2014-11-11 06:52:03

标签: java hibernate

我有三张桌子:

1。

    @Table(name = "VRTL_PI_BOI_DLVR")
    VrtlPiBoiDlvr
    private List<VrtlPiBoiDlvrActions> vrtlPiBoiDlvrActions;

    @OneToMany(mappedBy = "vrtlPiBoiDlvr", fetch = FetchType.EAGER,cascade = CascadeType.ALL)
    @Fetch(value = FetchMode.SUBSELECT)
    @Cache(region = "business", usage = CacheConcurrencyStrategy.READ_WRITE)
    public List<VrtlPiBoiDlvrActions> getVrtlPiBoiDlvrActions() {
        return vrtlPiBoiDlvrActions;
    }
    public void setVrtlPiBoiDlvrActions(
            List<VrtlPiBoiDlvrActions> vrtlPiBoiDlvrActions) {
        this.vrtlPiBoiDlvrActions = vrtlPiBoiDlvrActions;
    }

2。

@Table(name = "VRTL_PI_BOI_DLVR_ACTIONS")
VrtlPiBoiDlvrActions

private List<VrtlPiBoiDlvrIfn> vrtlPiBoiDlvrIfn;

private VrtlPiBoiDlvr vrtlPiBoiDlvr;


@OneToMany(mappedBy = "vrtlPiBoiDlvrActions", fetch = FetchType.EAGER,cascade = CascadeType.ALL)
@Fetch(value = FetchMode.SUBSELECT)
@Cache(region = "business", usage = CacheConcurrencyStrategy.READ_WRITE)
public List<VrtlPiBoiDlvrIfn> getVrtlPiBoiDlvrIfn() {
    return vrtlPiBoiDlvrIfn;
}




public void setVrtlPiBoiDlvrIfn(List<VrtlPiBoiDlvrIfn> vrtlPiBoiDlvrIfn) {
    this.vrtlPiBoiDlvrIfn = vrtlPiBoiDlvrIfn;
}


@ManyToOne
@JoinColumn(name = "BOI_DLVR_ID", referencedColumnName = "BOI_DLVR_ID", nullable = false)
@Fetch(value = FetchMode.SELECT)
public VrtlPiBoiDlvr getVrtlPiBoiDlvr() {
    return vrtlPiBoiDlvr;
}


public void setVrtlPiBoiDlvr(VrtlPiBoiDlvr vrtlPiBoiDlvr) {
    this.vrtlPiBoiDlvr = vrtlPiBoiDlvr;
}

3。

@Table(name = "VRTL_PI_BOI_DLVR_IFN")
VrtlPiBoiDlvrIfn

private VrtlPiBoiDlvrActions vrtlPiBoiDlvrActions;
    @ManyToOne
    @JoinColumns({@JoinColumn(name = "ACTION_ID", referencedColumnName = "ACTION_ID", nullable = false),
    @JoinColumn(name = "BOI_DLVR_ID", referencedColumnName = "BOI_DLVR_ID", nullable = false)})
    @Fetch(value = FetchMode.SELECT)
    public VrtlPiBoiDlvrActions getVrtlPiBoiDlvrActions(){
        return vrtlPiBoiDlvrActions;
    }

例外是:

Caused by: org.hibernate.MappingException: Unable to find column with logical name boi_dlvr_id in table VRTL_PI_BOI_DLVR_ACTIONS

我需要更改什么才能解决此问题?

0 个答案:

没有答案