how to use enum with jpa as a data member of persisted entity?
问题 Please best practice and 'how to' for using enum with jpa as a data member of persisted entity. what is the best practice? I want to persist "C", "O" from enum. (codes). If this is not the correct approach please suggest. Enum defination is -- public enum Status{ CLOSED ("C") OPEN ("O") private final int value; private Status(final int pValue){ this.value = pValue; } public int value(){ return this.value; } 回答1: expected Solution: enum defination: public enum Status { CLOSED(1), NEW(2),