0

I have a table column of type enum (mycoloumn enum('HIGH','LOW')) How do I map in my model java class? using JPA annotation. I am using MySQL database.

thanks, for help.

1 Answer 1

1

AFAIK, using JDBC, you would use setString() / getString() to access such a column. So you should probably map it as a corresponding Java enum, using its name:

public enum Volume { 
    HIGH, LOW
}

@Enumerated(EnumType.STRING)
private Volume volume;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.