You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Todd Nine <to...@spidertracks.com> on 2011/03/23 01:29:18 UTC
Proxy all types
Hi all,
I've run into an issue I can't seem to solve using the default Proxy
mechanism in Open JPA. For building indexes in Cassandra, I need to
store both the value at load time, and the current value via a proxy for
any field. I know the proxy has the change tracker, but that does not
contain a pointer to the original value. How can I go about creating a
custom proxy that will automatically be injected by Open JPA when an
Entity is saved or loaded?
Thanks,
Todd
Re: Proxy all types
Posted by Todd Nine <to...@spidertracks.com>.
Hi Michael,
Thanks for the help. I found the ProxyBean interface which seems to
be what I need. Is there an implementation for it, or do I need to
implement it for each primitive type?
Thanks,
Todd
On Wed, 2011-03-23 at 08:32 -0500, Michael Dick wrote:
> Hi Todd,
>
> In theory you can define your own ProxyManager which creates the
> appropriate proxy classes. I haven't tried it out myself, and I think
> some of it doesn't work as advertised (e.g. TrackChanges on the
> default ProxyManager), but it might be a good starting point.
>
> This area of the code needs some work, but if there's renewed interest
> we'll try to help.
>
> -mike
>
>
> On Tue, Mar 22, 2011 at 7:29 PM, Todd Nine <to...@spidertracks.com>
> wrote:
>
> Hi all,
> I've run into an issue I can't seem to solve using the
> default Proxy
> mechanism in Open JPA. For building indexes in Cassandra, I
> need to
> store both the value at load time, and the current value via a
> proxy for
> any field. I know the proxy has the change tracker, but that
> does not
> contain a pointer to the original value. How can I go about
> creating a
> custom proxy that will automatically be injected by Open JPA
> when an
> Entity is saved or loaded?
>
> Thanks,
> Todd
>
>
>
>
>
Re: Proxy all types
Posted by Michael Dick <mi...@gmail.com>.
Hi Todd,
In theory you can define your own
ProxyManager<http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_pc_scos_proxy_custom>which
creates the appropriate proxy classes. I haven't tried it out myself,
and I think some of it doesn't work as advertised (e.g. TrackChanges on the
default ProxyManager), but it might be a good starting point.
This area of the code needs some work, but if there's renewed interest we'll
try to help.
-mike
On Tue, Mar 22, 2011 at 7:29 PM, Todd Nine <to...@spidertracks.com> wrote:
> Hi all,
> I've run into an issue I can't seem to solve using the default Proxy
> mechanism in Open JPA. For building indexes in Cassandra, I need to
> store both the value at load time, and the current value via a proxy for
> any field. I know the proxy has the change tracker, but that does not
> contain a pointer to the original value. How can I go about creating a
> custom proxy that will automatically be injected by Open JPA when an
> Entity is saved or loaded?
>
> Thanks,
> Todd
>
>
>
>