Hi.
I need to map the following scenario>
TABLEA:
COL1 - INT - PK
COL2 - INT - PK
TABLEB:
TABLEA_COL1 - INT - PK
TABLEA_COL2 - INT - PK
COL3 - INT - PK
I have a TABLEA with a composite primary key.
TABLEB also has a composite primary key with 3 cols: 2 referencing TABLEA and another INT col.
public class TabelaB {
@Id
@ManyToOne
@JoinColumns({
@JoinColumn(name="TABELAA_COLUNA1", referencedColumnName="COLUNA1"),
@JoinColumn(name="TABELAA_COLUNA2", referencedColumnName="COLUNA2")})
private TabelaA tabelaA;
@Id
@Column(name = "COLUNA3", nullable = false)
private Integer coluna3;
}
This way is not working.
How can i do it?
Thanks,
Wellington
|