My model class (piece):
public class User ... {
@Enumerated(STRING)
private Status status;
...
public enum Status {
ACTIVE,
INACTIVE;
@Override
public String toString() {
return this.name().toLowerCase();
}
}
...
public String getStatus() {
return status.name().toLowerCase();
}
public void setStatus(Status status) {
this.status = status;
}
}
As you see above I override toString method, but no effect.
Enumeration store in database as ACTIVE
or INACTIVE
.
P.S. I use hibernate jpa
Thanks for help!
P.S.S. I ask because I write REST service that produces json (in json object better use lower case, if I'm not mistake)