I want to work with Enums in my Apex code and I'm wondering what the usual practice is for storing their value in a database. Like java, you shouldn't store the ordinal as an int because that could change if you edit the Enum. Storing the value as a string is the obvious thing but there appears to be no valueOf(enum_name) method to take us back from the String to the Enum.
Does everyone doing this just write something like this because there is nothing built in?
http://wordgraphs.com/post/2910/Convert-string-to-enum-in-Apex
or is there a more intuitive way to store a selected enum element in the database?
Thanks!