Hi:
I'm not sure about this, but my understanding was that JDO didn't support
ENUMS, JPA does (but I may be wrong).

Cheers,
Albert Attard

Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html>
- "I, Joan Crawford, I believe in the dollar. Everything I earn, I
spend."

2009/8/3 Jeff S (Google) <j...@google.com>

> Hi Tom,
> It should be possible to persist objects that use enums without needing to
> do your own additional mapping. I talked this over with Max Ross who
> frequents the Java runtime discussion group (
> http://groups.google.com/group/google-appengine-java) and he pointed out
> an example in the JDO unit tests which uses enums:
>
>
> http://www.google.com/codesearch/p?hl=en&sa=N&cd=2&ct=rc#79kbA0UmWLw/trunk/tests/org/datanucleus/test/HasEnumJDO.java
>
>
> <http://www.google.com/codesearch/p?hl=en&sa=N&cd=2&ct=rc#79kbA0UmWLw/trunk/tests/org/datanucleus/test/HasEnumJDO.java>Thank
> you,
>
> Jeff
>
> On Thu, Jul 30, 2009 at 5:09 PM, Tom Ball <tball...@gmail.com> wrote:
>
>> We have a simple task object, currently persisted using JDO (using App
>> Engine, of course).  We'd like to add a GREEN/YELLOW/RED status enum state.
>>  Defining the enum class is easy:
>>
>> public enum Status {
>>
>>   NONE("none"), GREEN("green"), YELLOW("yellow"), RED("red");
>>
>>
>>   private final String label;
>>
>>
>>   Status(String label) {
>>
>>     this.label = label;
>>
>>   }
>>
>>
>>   public String getLabel() {
>>
>>     return label;
>>
>>   }
>>
>> }
>>
>> We're stumped how to make this class persistent using JDO -- foreign keys
>> for the labels, perhaps?  Or do we get it for free, perhaps by JDO storing
>> the enum ordinal?
>>
>> Tom
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to