title: Mapping an enum in hibernate hbm?
body: <p>I have an enum as below.</p>
  
  <pre><code>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;
      }
  
  
  }
  </code></pre>
  
  <p>I need to save integer values not ONE and TWO. how can i do that? i have below config in my hbm:</p>
  
  <pre><code>&lt;property name="action"&gt;
              &lt;column name="ACTION" /&gt;
              &lt;type name="org.hibernate.type.EnumType"&gt;
                  &lt;param name="enumClass"&gt;com.ExampleEnum&lt;/param&gt;
              &lt;/type&gt;
          &lt;/property&gt; 
  </code></pre>
  
  <p>Do i need to have any other configuration to save integers? Please help me!</p>
  
  <p>Thanks!</p>