之前枚举类有value() text()这样的方法,可以直接插入value的值,现在发现插入的是name的值了,想去看看在哪里进行的转换,然后看能不能还是按照value的处理方式来。当前的nutzboot版本是 2.3.5-SNAPSHOT
当前是
update user set sex='MALE'
期望的是
update user set sex=0
枚举类
public enum GasUserSexEnum {
FEMALE(0, "女"),
MALE(1, "男");
private int value;
private String text;
GasUserSexEnum(int value, String text) {
this.value = value;
this.text = text;
}
public static GasUserSexEnum from(int value) {
for (GasUserSexEnum c : GasUserSexEnum.values()) {
if (value == c.value) {
return c;
}
}
throw new IllegalArgumentException("unknown GasUserSexEnum: " + value);
}
public int value() {
return value;
}
public String text() {
return text;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}