Hi,
something new about that?
I have the same problem:
Code:
/**
* get sycarCtrlCritere
*/
@ManyToOne
@JoinColumns({
@JoinColumn(name = "FK_SECTION", referencedColumnName = "FK_SECTION", insertable=false, updatable = false),
@JoinColumn(name = "NUM_CRIT", referencedColumnName = "NUM_CRIT", insertable=false, updatable = false)
})
public SycarCtrlCritere getSycarCtrlCritere() {
return this.sycarCtrlCritere;
}
/**
* set sycarCtrlCritere
*/
public void setSycarCtrlCritere(SycarCtrlCritere sycarCtrlCritere) {
this.sycarCtrlCritere = sycarCtrlCritere;
}
/**
* get sycarSqlAutorisation
*/
@ManyToOne
@JoinColumns({
@JoinColumn(name = "FK_SECTION", referencedColumnName = "FK_SECTION"),
@JoinColumn(name = "FK_METIER", referencedColumnName = "FK_METIER")
})
public SycarSqlAutorisation getSycarSqlAutorisation() {
return this.sycarSqlAutorisation;
}
/**
* set sycarSqlAutorisation
*/
public void setSycarSqlAutorisation(SycarSqlAutorisation sycarSqlAutorisation) {
this.sycarSqlAutorisation = sycarSqlAutorisation;
}
works, but I would like to write:
Code:
@ManyToOne
@JoinColumns({
@JoinColumn(name = "FK_SECTION", referencedColumnName = "FK_SECTION", insertable=false, updatable = false),
@JoinColumn(name = "NUM_CRIT", referencedColumnName = "NUM_CRIT")
})
public SycarCtrlCritere getSycarCtrlCritere() {
return this.sycarCtrlCritere;
}
Of course a solution could be fk_section duplication and creation of an equality constraint, or to drop sycarCtrlCritere composite key and to create a generated key.