Great! Yes essentially this is the last remaining thing that we need for a fully working JPA example with annotations. This class here has 2 TODO's in the bottom, this is where we need to wrap getters and setters with static method calls, passing the references to the property names and some local variables to the delegate:

http://svn.apache.org/repos/asf/incubator/cayenne/jpa/trunk/cayenne- jpa/src/main/java/org/apache/cayenne/jpa/enhancer/ DataObjectAccessorInjector.java

Andrus


On May 4, 2006, at 9:19 PM, Jeff Genender wrote:

Hi Andrus,

I would be honored to help out...as I think Bill would too...

Is how you described it the full issue?

Jeff

Andrus Adamchik wrote:
I need some help with CGLib. It is great for proxies, but our enhancer
changes the actual class instead of making a proxied subclass. Such
scenario is a pain... Maybe Jeff or someone else has an idea how to
implement the enhancing code below?

Basically I am trying to inject code calling a static delegate method in
three places:

1. Property getter start: DataObjectDelegate.beforeGetProperty
2. Property setter start: DataObjectDelegate.beforeSetProperty
3. Property setter end: DataObjectDelegate.afterSetProperty

I was able to implement a simpler case of creating synthetic properties with getters and setters (InterfaceMethodInjector), but got stuck with this one (see TODO's on the DataObjectAccessorInjector). I suspect we'll
have to use ASM for that, but if anyone can figure a CGlib solution,
please let me know.

Andrus


Reply via email to