I'm very much used to the Django 'choices' option for a model field:
GENDER_CHOICES = (
('M', 'Male'),
('F', 'Female'),
)
gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
That allows, for a model field, to easily match a database value with a (representation) string. And works with whatever sql type is chosen (Char, Int...)
In JPA that's not possible; you can make an Enum: but only use its ordinal or string. I find that overly limiting and complicated.
Is there in Play! something similar to the Django choices
, in particular to be used with the CRUD?
Or at least a pattern for the CRUD than just declare a simple String or int for the model field?
Related: