how to save enum value to DB with Hibernate?
Use this annotation at field level:
@Enumerated(EnumType.STRING)
You can add following enumeration, to indicate you want the String representation to be persisted :
@Enumerated(EnumType.STRING)
private ApartmentState apartmentState;
I also had to add
@Embeddable to the java enum
@Embeddable
public enum ApartmentState {
FREE, REQUESTED, BOOKED, LIVED, CLEANING, PROCESSING
}