-1
Hello, I would like to know how to annotate a property (ID) of my ENUM for when to persist in the bank?
Because currently JPA is saving the index of the Enum array and not the ID... My Enum:
@Getter
public enum SituacaoEnum {
ABERTO(1, "Aberto"),
EMEDICAO(2, "Em edicao"),
FECHADO(3, "Fechado");
Integer codigo;
String marca;
private Integer valor;
MarcaBalcaoEnum(Integer valor, String marca) {
this.valor = valor;
this.marca = marca;
}
}
You also have: https://answall.com/a/251747/112052
– hkotsubo