I have an enum:
public enum NotificationType {
OPEN("open"),
CLOSED("closed");
public String value;
NotificationType(String value) {
this.value = value;
}
}
I want to pass the custom string open or closed rather than OPEN or CLOSED to entity. Currently, I've mapped it in the entity as follows:
@Enumerated(EnumType.STRING)
private NotificationType notificationType;
Which is the best way to store/ fetch enum value?