How do I display an enumeration with a field in it?
public enum MyEnum{ HIGHSCHOOL ("H"), COLLEGE("C") private int value; public MyEnum getInstance(String value){...} } @Entity public class MyEntity { @Enumerated(...) private MyEnum eduType; }
How to annotate so that the values ββof H, C are stored in the database? If I save @Enumerated(EnumType.STRING) , HIGHSCHOOL instead of H will be stored in the database. If I use EnumType.ORDINAL , 1 instead of H will be stored in the database. Please suggest a solution.
user186004
source share