Hi Pay

> very thanks!! Now, I'm having CamelCase for enum class name. very nice!

Glad it works!

>     For instance:
>          (A) select * from someTable where priority_level = 1;
>          (B) select * from someTable where priority_level = 'Low';
>
>     (A) and (B) get the same data.

I didn't know about this feature in MySQL.

> What I'm thinking ...is it possible to get a enum Type Class with ID number,
> like below....

Java's Enum class provides an ordinal() method. For instance,

MyPriorityLevel.Low.ordinal() == 0
MyPriorityLevel.Normal.ordinal() == 1
MyPriorityLevel.High.ordinal() == 2

The difference is that Java starts counting at 0, whereas MySQL starts
at 1, 0 being reserved for "NULL". Would that work for you? Other than
that, could you show me a use-case where such a synthetic ID is
useful? MySQL is the only database that has this feature, so I'm a bit
reluctant to add support for it in this way...

Cheers
Lukas

Reply via email to