This is my enum :
package enums;
public enum SessionType {
SESSION_NORMAL(12), SESSION_PERFECT(5), SESSION_SOLO(1);
private int value;
private SessionType(int value) {
this.setValue(value);
}
public void setValue(int value) {
this.value = value;
}
public int getValue() {
return value;
}
public String toString(){
return this.name();
}
}
I've got a models class Session with an attribut type :
@Required
@Enumerated(EnumType.STRING)
@Column(name="type")
private SessionType type;
And I would like to do a query like that :
Session.find("type.value = 1");
Regards.