On Jan 16, 2008, at 6:53 PM, Michael Gentry wrote:

I was thinking updating the enum code to check for a custom/advanced
cayenne enum in addition to the current enum support.  That way you
could support basic enums (the current approach) or more advanced
enums, where you need to control the values stored in the database.

So I guess my question was - can we make it a generic "map" of sorts to avoid a "Cayenne Enum"? I'd rather we use some naming convention or an annotation on an arbitrary enum than introducing another special mapping primitive in Cayenne. Maybe we should start playing with annotations finally... E.g.:

public enum SomeArbitraryType {

        TYPE1, TYPE2, ...;
        
        @EnumCode
        public String getCode() {
                // this is dumb, but demonstrates the idea
                return name() + "_CODE";
        }
}


What do you think?

Andrus

Reply via email to