openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fay Wang <fyw...@yahoo.com>
Subject Re: Collection of enums: supported yet?
Date Fri, 04 Sep 2009 16:55:36 GMT
This feature is newly added in JPA 2.0 spec. I don't think it will be added to 1.2.x release.





----- Original Message ----
From: Matthew Adams <matthew@matthewadams.me>
To: users@openjpa.apache.org
Sent: Friday, September 4, 2009 8:35:32 AM
Subject: Re: Collection of enums: supported yet?

Sweet.  Do you suppose that will be in a 1.2.x release soon?

On Thu, Sep 3, 2009 at 2:29 PM, Fay Wang<fyw300@yahoo.com> wrote:
> This is currently supported in openjpa trunk.
>
>
>    @ElementCollection
>    @Enumerated(EnumType.STRING)
>    protected List<CreditRating> cr = new ArrayList<CreditRating>();
>
> where
>
>    public enum CreditRating { POOR, GOOD, EXCELLENT };
>
>
>
> Regards,
> Fay
>
>
>
>
>
> ----- Original Message ----
> From: Matthew Adams <matthew@matthewadams.me>
> To: users@openjpa.apache.org
> Sent: Thursday, September 3, 2009 1:00:59 PM
> Subject: Collection of enums: supported yet?
>
> Hi all,
>
> I searched the mailing list to determine the OpenJPA metadata required
> to store a collection of an enum type (ie, Collection<Color>,
> Set<Color>, List<Color>), and I noticed that Patrick answered a while
> ago (ca. 2007) that Kodo supports it but not OpenJPA.
>
> Is this still the case?  I can't find doc in the OpenJPA reference
> guide that explains how to map collections of enums.
>
> I don't really need EnumSet or EnumMap, either.   A plain, old
> Collection<Color> will do fine.
>
> If it's currently supported, how to I configure OpenJPA to store the
> values of an enum in a collection as that enum's name()?
>
> Thanks,
> Matthew
>
> --
> mailto:matthew@matthewadams.me
> skype:matthewadams12
> yahoo:matthewadams
> aol:matthewadams12
> google-talk:matthewadams12@gmail.com
> msn:matthew@matthewadams.me
> http://matthewadams.me
> http://www.linkedin.com/in/matthewadams
>
>
>
>
>



-- 
mailto:matthew@matthewadams.me
skype:matthewadams12
yahoo:matthewadams
aol:matthewadams12
google-talk:matthewadams12@gmail.com
msn:matthew@matthewadams.me
http://matthewadams.me
http://www.linkedin.com/in/matthewadams



      


Mime
View raw message