openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Adams <matt...@matthewadams.me>
Subject SOLVED (was: Re: Persistent interfaces & custom value handler)
Date Wed, 21 Oct 2009 19:28:02 GMT
@ElementStrategy

On Wed, Oct 21, 2009 at 10:10 AM, Matthew Adams <matthew@matthewadams.me> wrote:
> Perhaps this is a more direct way of asking the question:
>
> How do we tell OpenJPA that whenever it encounters a single- or
> multi-valued field of one of our persistent interface types, use our
> value handler?
>
> We currently use the @Strategy annotation on single-valued fields,
> which is ok, but (1) it doesn't work on multi-valued fields, and (2)
> we'd like to specify it across all entities without having to go to
> place the annotation on each field individually.
>
> On Wed, Oct 21, 2009 at 9:12 AM, Matthew Adams <matthew@matthewadams.me> wrote:
>> Hi all,
>>
>> We make use of persistent interfaces in our object model.  All of our
>> entities have a Long id, including all implementations of all
>> persistent interfaces, so we'd like to map any field that refers to a
>> persistent interface to two columns, one for the id value and one for
>> the implementation class name.  Our custom value handler is working
>> nicely for single-valued fields, but it is not treating collection of
>> an interface correctly.  Instead of OpenJPA iterating the collection
>> and calling our custom value handler, it is passing the collection
>> itself to our value handler.
>>
>> Question:  how do configure OpenJPA that whenever it encounters an
>> object of a given type, whether it be in a single- or multi-valued
>> field, to use a specific value handler?
>>
>> If we can't do that, how do we implement a value handler that handles
>> collection fields of types that need to have custom value handlers?
>>
>> 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