Hibernate version: 3.1
Mapping documents:
Code:
<class name="it.inform.w3.bean.ItemTypeProcessoConfigurazioneProprieta" table="W3T_PROPRIETA_CONFIGURAZIONI" select-before-update="true">
<meta attribute="class-description">Proprieta configurazioni</meta>
<composite-id name="id" class="it.inform.w3.bean.ItemTypeProcessoConfigurazioneProprietaPk">
[b]<key-property name="codentitt" column="codentitt" type="long"/>[/b] <key-property name="codentpss" column="codentpss" type="long"/>
<key-property name="codentcnf" column="codentcnf" type="long"/>
<key-property name="cafprp" column="cafprp" type="string" length="20"/>
</composite-id>
<many-to-one class="it.inform.w3.bean.ItemTypeAttributo" name="codentatt" not-null="true" fetch="join" insert="false" update="false">
[b]<column name="codentitt"/>[/b]
<column name="codentatt"/>
</many-to-one>
</class>
Code:
<class name="it.inform.w3.bean.ItemTypeAttributo" table="W3T_ATTRIBUTI" select-before-update="true">
<meta attribute="class-description">Attributi</meta>
<composite-id name="id" class="it.inform.w3.bean.ItemTypeAttributoPk">
<key-property name="codentitt" column="codentitt" type="long"/>
<key-property name="codentatt" column="codentatt" type="long"/>
</composite-id>
<property name="cafatt" type="string">
<column name="cafatt" length="50" sql-type="string" not-null="true"/>
</property>
<property name="dscatt" type="string">
<column name="dscatt" length="500" sql-type="string" not-null="true"/>
</property>
<many-to-one class="it.inform.w3.bean.Dominio" name="codentdom" not-null="true" fetch="join">
<column name="codentdom" not-null="true"/>
</many-to-one>
<property name="cafwkfitt" type="string">
<column name="cafwkfitt" length="8" sql-type="string" not-null="false"/>
</property>
<property name="cafwkfatt" type="string">
<column name="cafwkfatt" length="30" sql-type="string" not-null="false"/>
</property>
</class>
How could i map this two table??? The column "codentitt" is a part of key of table
ItemTypeProcessoConfigurazioneProprieta but the attribute "codentatt" is a many to one to table
ItemTypeAttributo that has a primary key with 2 columns where 1 of these is "codentitt"
This map doesn't work.. which is the correct one?
thanks