In mapping a pre-existing schema, it is rarely possible to map a given set of constants using an @Enumerated:
- Ordinals are non-sequential
- Names are incompatible with Java Enum Constants
- Names cannot be aliased to something more useful or conventional for Java Naming standards
Limitation is because specification states the name() will be used of an enum.
A typical example: Database uses 'N/A', which can never be mapped to an enum. Intuition will let us look for a solution to map this to 'NOT_AVAILABLE', both a valid name for an Enum Constant, and also conventional naming.
On top of this, an enum often has a representation in the Database, and a constant has usually other additional attributes that could be useful.
Better than using the name() of an @Enumerated, we should map the enumerated similar as an @Entity, and use the @ID.