title: How to set default enum value while using Hibernate's @Enumerated?
body: <p>I have a column in my DB table that I want to map to Java object.
  I marked the chosen column with annotation: </p>
  
  <pre><code>@Enumerated(EnumType.STRING)
  private RoleType code;
  </code></pre>
  
  <p>The problem is that on the DB side, except of values that I am interested of, there are invalid (in context of a task I am doing) values, so I want to map them to "Unknown" type.</p>
  
  <pre><code>ADMIN ("ADMIN "),
  CLIENT ("CLIENT"),
  SOMEBODY ("SOMEBODY"),
  UNKNOWN ("UNKNOWN");
  </code></pre>
  
  <p>Trying doing the above I got Hibernate mapping error.
  Is it possible to map values different than 3 mentioned in enum (ADMIN, CLIENT, SOMEBODY) to some default enum value (i.e. UNKNOWN) using Hibernate?</p>
  
  <p>EDIT:</p>
  
  <p>To make things clearer</p>
  
  <p>How values on DB side should be mapped on Java side:</p>
  
  <pre><code>TYPE_1  ---&gt;  UNKNOWN
  ADMIN  ---&gt;  ADMIN
  CLIENT  ---&gt;  CLIENT
  SOMEBODY  ---&gt;  SOMEBODY
  TYPE_2  ---&gt;  UNKNOWN
  SOMEBODY_2  ---&gt;  UNKNOWN
  </code></pre>