C
Chas Douglass
I'm interested in using the new Java 1.5 Enum type, but I'm wondering if
it's the best way to represent certain values retrofitting into a current
application.
The problem I'm having is understanding how to create enums "on the fly".
That is, the underlying value is already stored in a database as an
integer.
I'd like to retrieve that integer value and "reconstruct" an appropriate
enum.
Perhaps I'm missing something obvious (it wouldn't be the first time) but
the design of the enum type seems resistant to this simple application, and
probably for good reason.
I don't beleive it's reasonable to store a serialized version of the enum
-- that would break SQL queries on the database.
So is there a reasonable way to implement this, or should I stick with
"static final int" constants.
Thanks.
Chas Douglass
it's the best way to represent certain values retrofitting into a current
application.
The problem I'm having is understanding how to create enums "on the fly".
That is, the underlying value is already stored in a database as an
integer.
I'd like to retrieve that integer value and "reconstruct" an appropriate
enum.
Perhaps I'm missing something obvious (it wouldn't be the first time) but
the design of the enum type seems resistant to this simple application, and
probably for good reason.
I don't beleive it's reasonable to store a serialized version of the enum
-- that would break SQL queries on the database.
So is there a reasonable way to implement this, or should I stick with
"static final int" constants.
Thanks.
Chas Douglass