Hi All,
I'm having trouble mapping a collection of enums and would appreciate any help you can provide.
I am using the standard StringEnumUserType to persist enum properties but this does not work with collections of enums
Cheers,
Nim
Enum class:
Code:
public enum Authority {
ROLE_USER, ROLE_ADMIN;
}
Mapping:
Code:
<typedef class="persistence.StringEnumUserType" name="authority">
<param name="enumClassname">domain.Authority</param>
</typedef>
<set name="authorities" table="AUTHORITIES" lazy="true" cascade="all">
<key column="USER_ID" not-null="true"/>
<element type="authority" column="AUTHORITY" not-null="true"/>
</set?