Pinaki, I switched my old maven compile time enhancement on and it worked! So it seems to be only a runtime issue.
I blogged some of my Scala JPA entities and query examples to http://blog.fakod.eu/?p=955 (if you are interested...) Thx so much for help Christopher (Next thing is to work with Scala Collections. So I am sure I'll be back soon ;-) On Wed, Jun 9, 2010 at 11:33 PM, Pinaki Poddar <[email protected]> wrote: > >> I remember that I had some problems doing compile time enhancements >> (with Scala and Maven) but I will retry this tomorrow. > > I am not conversant with Scala to comment whether that will introduce any > further complexity to OpenJPA enhancement step. But I have heard numerous > painful user experience on enhancement. > It is sad because build-time enhancement is really a simple (I mean simple > as easy) process of > invoking a Java program with correct classpath and a single argument. > > I have added the bare essentials in an Ant script required to enhance domain > classes. > > Please note that > 1. how the ${jap.properties} variable is defined with its parent > directory META-INF followed by the file name persistence.xml and then > appended with an unit name. The content of the persistence.xml should use > the same unit name and list all the classes in <class> clause. > > 2. the classpath should include the parent directory of META-INF > directory > > 3. fork the java process > > 4. ensure OpenJPA libraries are in classpath. Recent OpenJPA distribution > folds all runtime dependencies in a single jar file. > > > <!-- JPA configuration file anchored by the persistence unit name > --> > <property name="jpa.properties" > value="META-INF/persistence.xml#OpenBooks"/> > <!-- root directory of Java Source files > --> > <property name="src.dir" value="${basedir}/src/main/java"/> > <!-- root directory of compiled class files > --> > <property name="classes.dir" value="${target.dir}/classes"/> > <!-- root directory of resource files e.g web.xml or persistence.xml > --> > <property name="rsrc.dir" value="${basedir}/src/main/resources"/> > > <path id="compile.classpath" > description="Compilation classpath requires OpenJPA specific > library > because of bytecode enhancement"> > <pathelement location="${src.dir}" /> > <pathelement location="${classes.dir}" /> > <pathelement location="${rsrc.dir}" /> > <fileset dir="${openjpa.lib}"> > <include name="*.jar" /> > </fileset> > </path> > > <target name="enhance" > description="Enhance persistent domain classes."> > <java classname="org.apache.openjpa.enhance.PCEnhancer" > fork="true"> > <arg value="-properties" /> > <arg value="${jpa.properties}" /> > <classpath refid="compile.classpath" /> > </java> > </target> > > > ----- > Pinaki > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/identity-class-IllegalArgumentException-tp5159262p5160588.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >
