title: hibernate - How to annotate a property as enum with a field
body: <p>How do I map an enum with a field in it?</p>
  
  <pre><code>public enum MyEnum{
  HIGHSCHOOL ("H"), COLLEGE("C")
  private int value;
  public MyEnum getInstance(String value){...}
  }
  
  @Entity
  public class MyEntity {
  @Enumerated(...)
  private MyEnum eduType;
  }
  </code></pre>
  
  <p>How do I annotate so that values H, C will be persisted in the database? If I keep <code>@Enumerated(EnumType.STRING)</code>, HIGHSCHOOL instead of H will be stored in the database. If I use <code>EnumType.ORDINAL</code>, 1 instead of H will be stored in the database. Kindly suggest a solution.</p>