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:Model
And such structure of classes in 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
}