Cayenne allows to use any Java enumeration as an ObjAttribute type. In CayenneModeler's ObjEntity editor, under the Attributes tab, enter the full class name for your enumeration under the Java Type column, and this is it:
To convert a DB column value to an enumeration instance and back Cayenne uses enumeration's name for character colums (CHAR, VARCHAR, etc) or its ordinal for numeric columns. Also Cayenne allows users to explicitly control what value in DB corresponds to a given enumeration instance. To do that, a custom enumeration must implement org.apache.cayenne.ExtendedEnumeration interface, overriding "getDatabaseValue()" method to provide the DB value. Here is an example of a custom enumeration that maps to DB integers:
This instructs Cayenne to read/write 3, 6, and 9 as RED, GREEN, and BLUE, respectively. The order is unimportant - if someone re-orders them to be BLUE, GREEN, and RED in the enum class, all values will still map correctly.