If I use the annotation @Size(min = 1, max = 50) in Hibernate, I can write a string to the database with at least one and at most 50 characters.
But now I need to restrict the possible values to only two numbers: 12342 and 13409.
Is there any annotation that allows this?