Hi,
I have the following EmbeddedId:
Code:
@Embeddable
public class MyPK implements Serializable {
@ManyToOne
@JoinColumns({
@JoinColumn(name = "CO_COMPRA", referencedColumnName="CO_COMPRA", insertable=false, updatable=false)
, @JoinColumn(name = "CO_CARRINHO", referencedColumnName="CO_CARRINHO", insertable=false, updatable=false)
})
private Entity1 compra;
@ManyToOne
@JoinColumns({
@JoinColumn(name = "CO_APOSTA", referencedColumnName="CO_APOSTA", insertable=false, updatable=false)
, @JoinColumn(name = "CO_CARRINHO", referencedColumnName="CO_CARRINHO", insertable=false, updatable=false)
})
private Entity2 aposta;
...
}
Code:
@Entity
@Table(name = "XPTO", schema=DatabaseConfig.SCHEMA)
public class Entity3 ...{
@EmbeddedId
private MyPK id;
...
}
The columns names are correctly, however hibernate throws:
Repeated column in mapping for entity: br.Entity3 column: CO_CARRINHO (should be mapped with insert="false" update="false").
Is it a bug?? Is there any other way to do this?