This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
for enum type you can choose EnumType.ORDINAL or EnumType.STRING. Going for string is definetely better because ordinal mandates that you never ever change the order of definition of the enum-types. On the other hand string also makes the DB entry bigger as necessary (taking the constant name, which can be quite long).
So I want to use an explicit mapping (that JPA uses getId() method).
How or is it possible with JPA to define a custom method of an java enum type?