I have an enum as below.
public enum ExampleEnum {
ONE(1), TWO(2);
private int action;
private ExampleEnum (int action){
this.action = action;
}
/**
* @return the action
*/
public int getAction() {
return action;
}
/**
* @param action the action to set
*/
public void setAction(int action) {
this.action = action;
}
}
I need to save integer values not ONE and TWO. how can i do that? 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 save integers? Please help me!
Thanks!