Hi all,
We've got a db structure like this:
ORGS (id, name)
CATEGORIES (id, parent, name, provider)
ORG_CAT (org_id, provider, cat_id)
We use many Category systems and Providers are the owners (or creators) of those systems. In one system, one ORG can only be associated with one Category.
The list of providers is rather static so we want to use Enum like this:
Code:
public enum CategoryProvider {
A("A"),
B("B"),
C("C");
private CategoryProvider(String name) {
this.name = name;
}
}
We've been able to map the "provider" property of Category as CategoryProvider as follows:
Code:
<property name="provider">
<column name="provider"/>
<type name="org.hibernate.type.EnumType">
<param name="enumClass">CategoryProvider</param>
<param name="sqlType">12</param>
</type>
</property>
We want to have a map like this in ORG:
Code:
Map<CategoryProvider, Category>categories;
The problem is the <map-key> element only accept "type" as attribute and we haven't found the way to specify the "enumClass" parameter anywhere.
Anyone could lend a hand? Thanks very much.
Kean.