0

good day everyone,

i'm currently working on a spring application for school project, it's about a form generator. anyway i have a question entity which has a field called type, i want that field to be one of 3 different values (radio which is the default, checkbox, or input) but i didn't know how to do this with hibernate annotations or even with the spring constraints annotations so i was hoping someone here has an idea on how to do this.

thanks for your time everyone and hope you have a nice day.

3
  • 1
    Use an enum. That's what they're for. Commented Nov 18, 2018 at 16:16
  • you can make use of this solution Commented Nov 18, 2018 at 16:19
  • ok thanks i'll try those answers Commented Nov 18, 2018 at 16:46

0

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.