Hello there! I have a many to one relationship where the end association has a composite key. The problem is that one of the keys are also being used by my many side class:
Code:
<composite-id
name="pk"
class="PK"
>
<key-property
name="codigoReceita"
type="CodigoReceitaEnum"
column="CODREC"
/>
<key-property
name="cidade"
type="java.lang.Integer"
column="CODCID"
/>
<key-property
name="contrato"
type="java.lang.Integer"
column="CONTRA"
/>
<key-property
name="ponto"
type="java.lang.Integer"
column="PONTO"
/>
</composite-id>
<many-to-one
name="pacote"
class="Pacote"
cascade="none"
outer-join="auto"
update="true"
insert="true"
>
<column name="CODCID" ></column>
<column name="CODPROG"></column>
</many-to-one>
Well, Hibernate complains about CODCID being used twice. I've already mapped a column twice and then used the update/insert = false. Problem is I can't add these properties to my many-to-one columns.
How can I solve this?
Regards