shrndegruv wrote:
jason
do I need a mapping for the Enum Type?
edit: no
Unfortuately, I did forget about that. You will need some sort of usertype to map the enum to a string, either the standard Hibernate type or one of your own doing.
Here's how the type is mapped for the EnumSet:
Code:
<typedef class="com.mainpnt.lis.orm.EnumUserType" name="testAction">
<param name="enumClassName">
com.mainpnt.lis.pooling.domain.MatrixTarget$TestAction
</param>
</typedef>
shrndegruv wrote:
Also, should the element column type be String or my Enum type?
edit: yes
The type you save into the database should be a string.
shrndegruv wrote:
when you say
private Set<TestAction> requiredActions = EnumSet.noneOf( TestAction.class );
in the general case, create a Set on the class that holds the EnumSet, and when the Set of enum types get hydrated, have the setter recreate the EnumSet?
You want to create a set of Enums, since that's presumably what matters, and what you want to persist. TestAction is an enum (you can see that in my first post). When the set is loaded, the EnumUserType transforms the strings into the enums.