I am converting an application from Grails to Java and need to find the equivalent of the inList constraints in grails to the spring/hibernate equivalent.
static constraints = {
stringValue(inList:['testValue', 'testValue', 'testValue', 'testValue', 'test value', 'test&value'], nullable:false)
}
I am not sure what the hibernate/spring equivalent is for this type of constraint.
UPDATE
I tried using an enum but I need to include special characters such as & and spaces so to my knowledge only strings will work since I have to pull these values from a database.