Hi,
I'm using the persistent enum approach that is most easily found on the web to persist a set of enums.
I have this done through an user type, like this:
Code:
<set name="roles">
<key column="USER_ID"/>
<element type="MyRoleUserType" column="ROLE_ID"/>
</set>
I also have a specialized Hibernate user type called PersistableEnumType, for the various enums in my system. This must be used with a parameter.
I would like to use the generic PersistableEnumType to persist a set of Roles but I cannot because I can't pass the right parameter in when defining an element. This could be easily accomplished if <element> allowed for nested <type> entries, just like <property> does:
Code:
<set name="roles">
<key column="USER_ID"/>
<element>
<column name="ROLE_ID"/>
<type name="PersistableEnumType">
<parameter name="enum">my.pkg.Role</parameter>
</type>
</element>
</set>
Thanks,
Mihai