title: JPA Enum Inheritance
body: <p>I have an interface called 'Category' and 4 enum implementing this interface. 
  Those enums are decided in categories and have different types in it. 
  Example: </p>
  
  <pre><code>#Interface
  interface BillCategory
  
  #Enum 1
  public enum GroceryPurchase implements BillCategory {
    VEGAN,  
    VEGETARIAN,
    PESCITARIAN,
    FLEXITARIAN, 
    OMNIVORE
  
  
  #Enum 2
  enum ElectronicPurchase implements BillCategory{ 
   SMARTPHONE, HARDWARE, SOFTWARE }
  </code></pre>
  
  <p>I aded the field to an entity class.</p>
  
  <pre><code>private BillCategory billCategory;
  </code></pre>
  
  <p>And when I start the Spring Environemnt I get the following Hibernate/JPA error: </p>
  
  <pre><code>Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not determine type for: net.wizypay.wizypay.bill.model.BillCategory, at table: bill_entity, for columns: [org.hibernate.mapping.Column(bill_category)]
  </code></pre>
  
  <p>How can I solve this problem? I do not want to summarise the enums to one. Is there a better approach? Or just impossible to persist such data. </p>