title: JPA Hibernate Persist any Enum (a Map key) in human readable format?
body: <p>Say you have a class which needs to save some mapped items, using any Enum for the key. Using this mapping it generates e.g. <code>varbinary</code> (SQL Server) with a hexadecimal value. </p>
  
  <pre><code>@Entity
  public abstract class X {
      @ElementCollection
      private Map&lt;Enum, Boolean&gt; values;
  }
  </code></pre>
  
  <p>This works but the main issue is readability. The data in the database isn't human readable. trying to use <code>@MapKeyEnumerated(EnumType.STRING)</code> or with EnumType.Ordinal doesn't work since the Enum can be any type and that saves the <code>MyEnum.SOME_VALUE</code> as "SOME_VALUE".</p>
  
  <p>Is it possible to intercept the save/retrieve and save a fully qualified name (com.x.myenum.value) or something legible which could be used to restore the enum instead of a hexadecimal value?</p>