Say I have an enum:
public enum NotificationType {
Store("S"),
Employee("E"),
Department("D"),
All("A");
public String value;
NotificationType(String value) {
this.value = value;
}
}
I want to store S
or E
rather than Store
or Employee
in the database. Currently, I've mapped it in the entity as follows:
@Enumerated(EnumType.STRING)
private NotificationType notificationType;
but unsure how to get what I want, if possible.