openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From catalina wei <catalina....@gmail.com>
Subject Re: how to store collection of enums as strings
Date Sat, 28 Mar 2009 20:33:45 GMT
Ted,
If you are using Java 5, then you could use name() or toString() API on the
Enum to get the name of the enum constant in String value.

Catalina

On Wed, Mar 25, 2009 at 9:48 AM, Tedman Leung <tedman@sfu.ca> wrote:

> Anyone know how to store a collection of enums as Strings instead of their
> ordinal values? (preferably with annotations...)
>
> i.e.
>        @ManyToMany
>        private Set<MyEnum> myEnums=new HashSet<MyEnum>();
>
>
> --
>                                                           Ted Leung
>                                                           tedman@sfu.ca
>
> It's time for a new bike when the bulb in your shift light burns out.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message