Hello!
I would like to use an enum as datatype for a field and i already found some basic instructions on how to do this on google.
I don't want to use annotations, so the xml way is the only one i can go.
I have found a class GenericEnumUserType on
http://community.jboss.org/wiki/Java5EnumUserType which probably works as i need it.
My xml entry looks like this:
<typedef name="permission" class="model.enums.GenericEnumUserType">
<param name="enumClassName">model.enums.PermissionEnum</param>
</typedef>
<class...
<property name="permission" type="permission">
<column name="permission"/>
</property>
...
The first problem is that the datatype of the field is GenericEnumUserType when i process the hbm.xml with hbm2java.
The next thing is that i can not put my typedef-entries into a separate file, they have to be in the same file as they are used in, otherwise the type is not set correctly.
Please help me with this!
Thanks in advance!