openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: How to get hardcoded ordinal values to map to specific Enum values?
Date Fri, 18 Dec 2009 21:58:55 GMT
Hi,

I haven't used this, but it seems that you should start looking at  
EnumValueHandler: http://openjpa.apache.org/builds/latest/docs/javadoc/org/apache/openjpa/jdbc/meta/strats/EnumValueHandler.html

Does anyone here know where to find examples of annotating a field  
with a custom ValueHandler?

Craig

On Dec 18, 2009, at 11:01 AM, KARR, DAVID (ATTCINW) wrote:

>> -----Original Message-----
>> From: Daryl Stultz [mailto:daryl@6degrees.com]
>> Sent: Thursday, December 17, 2009 6:52 PM
>> To: users@openjpa.apache.org
>> Subject: Re: How to get hardcoded ordinal values to map to specific
>> Enum values?
>>
>> On Thu, Dec 17, 2009 at 6:31 PM, Craig L Russell
>> <Craig.Russell@sun.com>wrote:
>>
>>> You would need your own value type as an extra attribute of your
>> Enum
>>> class, and then use a special OpenJPA mapping to get the values to
>> and from
>>> the database.
>>>
>>
>> Maybe it's the "special OpenJPA mapping" info the OP is looking  
>> for. I
>> know
>> I'm interested in it.
>
> Yes, I'm probably going to have to find a reasonable solution for  
> this.
> My database stores the custom ordinal values, and I have to map to a
> real Enum value.
>

Craig L Russell
Architect, Sun Java Enterprise System http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message