I am really impressed by the current EJB3 implementation, but got a question about enums in entities.
Is it possible to use an enum as primary-key (@Id) of an entity ?
I tried the following two solutions:
----------------------
1.) Adding "@Id" on the enum-typed property, which results in a byte-array-datatype.
2.)
@Embeddable public enum GenderType { MAN,WOMAN; public int getOrdinal() { return ordinal(); } public void setOrdinal(int ordinal) { } }
1) Why are you annotating it with embeddable ?
2) Why do you overwrite the ordinal stuff ? Are you looking for trouble ?