I have a domain class:
class MyUser {
..
int sex
int qualification
int occupation
..
}
Suppose I want to constraint these integer categories, for example:
occupation : [0:"not occupied", 1:"architect", 2:"student", 3:"policeman" and so on..]
I would like to have on database the integer values and have displayed on my views the string representation of the integer (can this behaviour be scaffoilded automatically?).
is there a way to do this quickly in the grails way?
thanks!