title: JPA Enum type as table in database
body: <p>So, my question is next. How can I map enum type in a database as a table. I want to have a table with values of my Enum.I want to have such structure in database:<a href="https://i.stack.imgur.com/8O9tp.png" rel="nofollow noreferrer">Model</a></p>
  
  <p>And such structure of classes in code: </p>
  
  <pre><code>@Entity
  public class MainEntity implements Serializable {
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @NotNull
      @Column
      private Integer id;
  
      @Column
      private Enum enum;
  
      @NotNull
      @Column
      private String any_other_attribute;
  
  }
  public enum Enum implements Serializable {
      First, Second, Third
  }
  </code></pre>