These mappings are equivalent ?
Code:
<set name="ds001ProcessoFechamentos" inverse="true" table="rel_fatura_ds001_processo">
<key>
<column name="cod_orgao" length="12" not-null="true" />
<column name="num_ano_fatura" precision="4" scale="0" not-null="true" />
<column name="num_fatura" precision="7" scale="0" not-null="true" />
</key>
<many-to-many entity-name="br.com.dsystems.ds001.models.Ds001ProcessoFechamento" >
<formula>cod_orgao</formula>
<column name="num_ano_proces" precision="4" scale="0" not-null="true" />
<column name="num_proces" precision="7" scale="0" not-null="true" />
</many-to-many>
</set>
Code:
<set name="ds001ProcessoFechamentos" inverse="true" table="rel_fatura_ds001_processo">
<key>
<column name="cod_orgao" length="12" not-null="true" />
<column name="num_ano_fatura" precision="4" scale="0" not-null="true" />
<column name="num_fatura" precision="7" scale="0" not-null="true" />
</key>
<many-to-many entity-name="br.com.dsystems.ds001.models.Ds001ProcessoFechamento" >
<column name="cod_orgao" length="12" not-null="true" />
<column name="num_ano_proces" precision="4" scale="0" not-null="true" />
<column name="num_proces" precision="7" scale="0" not-null="true" />
</many-to-many>
</set>
The second mapping is the mapping that throws the exception:
org.hibernate.MappingException: Repeated column in mapping for collection
And the first mapping is the work arround that I find to solve the problem, but I don´t know if these two mappings are equivalent... I hope so...
They are ?
Thanks in advance
Rodrigo Kerkhoff