Hi Now I remenber I had to pass a blank persistence.xml file so that the enhancer would work. See my previous post for the ant target, and below for the dummy persistence file.
<?xml version="1.0"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="none"/> </persistence> This method has been working great for me. David On Tue, 16 Jun 2009 06:45:02 -0700 (PDT) "B.L. Zeebub" <[email protected]> wrote: > > > > Michael Dick wrote: > > > > Hi Roger, > > > > The entities are definitely not getting enhanced. Have you tried > > specifying > > the .class files instead of the .java ones? > > > > ie : > > <openjpac> > > <!-- classpath where the tool look for classes to > > enhance. This is the default location in a NB project > > directory layout where classes are built --> > > <classpath> > > <pathelement location="${basedir}/build/classes"/> > > </classpath> > > <!-- I put it in here. See below the persistence.xml > > file --> > > <config > > propertiesFile="${basedir}/src/META-INF/persistence.xml"/> > > * <fileset dir="${basedir}/build/classes"> > > <include name="**/entities/*.class"/> > > </fileset> > > * </openjpac> > > > > > > Ok - I've made the change that you suggested and run "clean & build". > There are no error messages during the build phase. > > javap output for the ./build/Ecu.class is now showing > Compiled from "Ecu.java" > public class com.blackbox.flashloader.entities.Ecu extends > java.lang.Object implements > java.io.Serializable,org.apache.openjpa.enhance.PersistenceCapable{ > > so at least the Ecu.class has been enhanced. I've checked a few > others and they're showing that they've been enhanced as well. Just > to double check I've expanded my .jar file from the dist directory > and the classes in there are showing that they've been enhanced as > well. > > However, on running my program, when creating the > EntityManagerFactory I'm still getting the > and the list with all my entity classes in it, and the list contains a > reference to class com.blackbox.flashloader.entities.Ecu 2415 > FlashLoaderPU INFO [main] openjpa.Enhance - Creating subclass for > "[<list of classes > here>]". This means that your application will be less efficient and > here>will > consume more memory than it would if you ran the OpenJPA enhancer. > Additionally, lazy loading will not be available for one-to-one and > many-to-one persistent attributes in types using field access; they > will be loaded eagerly instead. > > I've run find ./ -name Ecu.class in the top level project directory > and it only finds the two I was expecting, the class in the ./build > directory and the class where I expanded my jar file! > > Now I'm *really* confused >
