Hi,
i have a mapping like this:
i just will mapping a Map in
Hibernate version: 2.1.6
Code:
<class name="Page" table="pages">
<id name="id" column="id" unsaved-value="-1">
<generator class="identity"/>
</id>
<property name="name" column="name"/>
<set name="htmlsInternal" table="page_htmls">
<key column="page_id"/>
<many-to-many column="html_id" class="Html"/>
</set>
</class>
<class name="Html" table="htmls">
<id name="id" column="id" unsaved-value="-1">
<generator class="identity"/>
</id>
<property name="name" column="name"/>
<property name="code" column="code"/>
<property name="datetime" column="datetime"/>
<property name="active" column="active"/>
<property name="lang" column="lang"/>
</class>
this is working but now i must change the collection type for the html objects in page object to a map.
so i changed my mapping to this:
Code:
<class name="Page" table="pages">
<id name="id" column="id" unsaved-value="-1">
<generator class="identity"/>
</id>
<property name="name" column="name"/>
<map name="htmlsInternal" table="page_htmls">
<key column="page_id"/>
<index-many-to-many column="html_id" class="Html"/>
</map>
</class>
<class name="Html" table="htmls">
<id name="id" column="id" unsaved-value="-1">
<generator class="identity"/>
</id>
<property name="name" column="name"/>
<property name="code" column="code"/>
<property name="datetime" column="datetime"/>
<property name="active" column="active"/>
<property name="lang" column="lang"/>
</class>
but hits dos not work, i allways get a mapping error
can anyone tell me how must change the mapping that it is correct?
Thank you.
mfg Gideon