I have an enumeration as shown below.
public enum ExampleEnum { ONE(1), TWO(2); private int action; private ExampleEnum (int action){ this.action = action; } public int getAction() { return action; } public void setAction(int action) { this.action = action; } }
I need to save integer values, not ONE and TWO. How can i do this? I have below config in my hbm:
<property name="action"> <column name="ACTION" /> <type name="org.hibernate.type.EnumType"> <param name="enumClass">com.ExampleEnum</param> </type> </property>
Do I need to have any other configuration to store integers? Please help me!
Thanks!
source share