Problem mapping many-to-many relation with composite-id:
I have the following situation:
The table ELABORATION is:
Code:
<hibernate-mapping">
<class name="Elaboration" ltable="ELABORATIONS">
<composite-id>
<key-property name="name" type="string">
<column name="NAME" not-null="true"/>
</key-property>
<key-property name="startApplicability" type="date">
<column name="START_APPLICABILITY" not-null="true"/>
</key-property>
</composite-id>
<property name="setInputs" type="integer">
<column name="SET_INPUTS" not-null="true"/>
</property>
<property name="description" type="string">
<column name="DESCRIPTION" not-null="false"/>
</property>
[b] <list name="inputs" table="INPUTS" cascade="save-update">
<key>
<column name="ELABORATION"/>
<column name='"SET"'/>
</key>
<many-to-many entity-name="Input">
<column name="NAME"/>
<column name='"SET_INPUTS"'/>
</many-to-many>
</list>
[/b]
</hibernate-mapping>
and
Code:
<hibernate-mapping>
<class name="Input" table="INPUTS">
<composite-id>
<key-property name="elaboration" type="string">
<column name='"ELABORATION"' not-null="true"/>
</key-property>
<key-property name="set" type="integer">
<column name='"SET"' not-null="true"/>
</key-property>
<key-property name="index" type="integer">
<column name='"INDEX"' not-null="true"/>
</key-property>
</composite-id>
<property name="parameter" type="string">
<column name='"PARAMETER"' not-null="true"/>
</property>
<property name="remarks" type="string">
<column name='"REMARKS"' not-null="false"/>
</property>
</class>
</hibernate-mapping>
and i want to retrieve a list ot Inputs associated with the elaboration name. It would be a many-to-many association. In the database there are not intermediate table and it is not possible to create it.
the database has the following structure
Table ELABORATIONS:
*NAME
*START_APPLICABILITY
*SET_INPUTS
DESCRIPTION
Table INPUTS:
*ELABORATION
*SET
*INDEX
PARAMETER
where the * means that the column is part of the primary key.
Can anyone help me? im really desperate