Hi! How i can map structure like this into
class A{
Map<SomeEnum, B> foo;
}
where key in foo is representation of role in a_ has _b ?
Thanks!
Hi! How i can map structure like this into
class A{
Map<SomeEnum, B> foo;
}
where key in foo is representation of role in a_ has _b ?
Thanks!
If you want the name of the enum constants in your table column:
<hibernate-mapping ...>
...
<typedef name="role" class="org.hibernate.type.EnumType">
<param name="enumClass">SomeEnum</param>
<param name="type">12</param>
</typedef>
...
<class name="A" table="a">
...
<map name="foo" table="a_has_b">
<key column="a_id"/>
<map-key type="role" length="20" column="role"/>
<many-to-many class="b" column="b_id"/>
</set>
...
</class>
...
<class name="B">
...
</class>
...
</hibernate-mapping>