Details
-
New Feature
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
2.0.0-beta
-
None
-
None
-
All
Description
Enums work as primary keys in TopLink and EclipseLink. DataNucleus supports them, too:
http://www.datanucleus.org/products/accessplatform/jpa/primary_key.html
It would be good to also include this in the specification because, not to support type safety in primary keys is fairly sad.
Enum is a basic language feature, and most applications would enjoy significant benefits by mapping the keys of those little system behavior controlling lookup tables to enums.
Consider a payment_type table. One can only generate the IDs of the table and use them for switching safely when the ids are mapped to enums. Any such application would typically have a PaymentType enum anyway.