users@glassfish.java.net

Re: use of enum class in entity

From: <glassfish_at_javadesktop.org>
Date: Tue, 28 Jul 2009 08:50:01 PDT

If you put an "UNKNOWN" as the first thing in your enum as in my example code, that will get a ZERO (0) value, which will shift the other values to what you want them to be. Just don't use the UNKNOWN in your code, and check for it before storing the entity. If the UNKNOWN is present, throw an exception.
[Message sent by forum member 'culli' (culli)]

http://forums.java.net/jive/thread.jspa?messageID=357904