The PCEnhancer has its roots in the Kodo (the JDO provider that OpenJPA is based on). The answer to your question comes from the JDO spec :
Enhancement makes the following changes to persistence aware classes: • modifies executable code that accesses fields of PersistenceCapable classes not known to be not managed, replacing getfield and putfield calls with calls to the generated accessor and mutator methods. Typical applications will interact with entities (PersistenceCapable classes) through the accessor and mutator methods anyway, so any modifications should be a no-op. But the potential for modification is there. Hope this helps, -mike On Sun, Sep 4, 2011 at 7:40 PM, Laird Nelson <[email protected]> wrote: > I wanted to verify that this ominous PCEnhancer warning: > > 3294 weaving WARN [main] openjpa.Enhance - Type "class > > com.foobar.FoobarPropertyEditor" loaded by > > org.apache.openjpa.lib.util.TemporaryClassLoader@5fd1358f has no > metadata; > > enhancing as persistence aware. If you intended for "class > > com.FoobarPropertyEditor" to be persistence-capable, then this means that > > OpenJPA could not find any metadata for "class > > com.foobar.FoobarPropertyEditor". This can happen if the directory > > containing your metadata is not in your CLASSPATH, or if your metadata > files > > are not named properly. See the documentation on metadata placement for > more > > information. > > > > ...simply means that the OpenJPA PCEnhancer effectively took no action on > the class in question. > > I am running the PCEnhancer through Ant as invoked by the > maven-antrun-plugin; I have opted to run it over a directory tree (via > Ant's > <fileset> element) rather than specifying the <class> files in the > persistence.xml. For various reasons, this means that among the many > .classfiles in the directory tree are classes that are not entities. > I want to > make sure that they are not being modified in any way. I looked at the > .class file in emacs and didn't see anything obvious. > > Best, > Laird > > -- > http://about.me/lairdnelson >
