You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by cu...@apache.org on 2011/11/28 23:24:33 UTC
svn commit: r1207658 - in /openjpa/trunk/openjpa-project/src/doc/manual:
ref_guide_integration.xml ref_guide_pc.xml
Author: curtisr7
Date: Mon Nov 28 22:24:32 2011
New Revision: 1207658
URL: http://svn.apache.org/viewvc?rev=1207658&view=rev
Log:
OPENJPA-302: Update user manual for PCEnhancer usage. Patch contributed by Jacob Nowosatka.
Modified:
openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_integration.xml
openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml
Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_integration.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_integration.xml?rev=1207658&r1=1207657&r2=1207658&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_integration.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_integration.xml Mon Nov 28 22:24:32 2011
@@ -236,7 +236,9 @@ files that should be processed. You can
<filename>.class</filename> files. If you do not specify any files, the task
will run on the classes listed in your <filename>persistence.xml</filename> or
<link linkend="openjpa.MetaDataFactory"><literal>
-openjpa.MetaDataFactory</literal></link> property.
+openjpa.MetaDataFactory</literal></link> property. You must, however, supply the
+classpath you wish the enhancer to run with. This classpath must include, at
+minimum, the openjpa jar(s), persistence.xml and the target classes.
</para>
<para>
Following is an example of using the enhancer task in a <filename>build.xml
@@ -247,17 +249,36 @@ Following is an example of using the enh
Invoking the Enhancer from Ant
</title>
<programlisting>
+
<target name="enhance">
- <!-- define the openjpac task; this can be done at the top of the -->
- <!-- build.xml file, so it will be available for all targets -->
- <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask"/>
+ <!-- Define the classpath to include the necessary files. -->
+ <!-- ex. openjpa jars, persistence.xml, orm.xml, and target classes -->
+ <path id="jpa.enhancement.classpath">
+ <!-- Assuming persistence.xml/orm.xml are in resources/META-INF -->
+ <pathelement location="resources/" />
- <!-- invoke enhancer on all .java files below the model directory -->
- <openjpac>
- <fileset dir=".">
- <include name="**/model/*.java" />
- </fileset>
- </openjpac>
+ <!-- Location of the .class files -->
+ <pathelement location="bin/" />
+
+ <!-- Add the openjpa jars -->
+ <fileset dir=".">
+ <include name="**/lib/*.jar" />
+ </fileset>
+ </path>
+
+
+ <!-- define the openjpac task; this can be done at the top of the -->
+ <!-- build.xml file, so it will be available for all targets -->
+ <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="jpa.enhancement.classpath" />
+
+ <!-- invoke enhancer on all .class files below the model directory -->
+ <openjpac>
+ <classpath refid="jpa.enhancement.classpath" />
+ <fileset dir=".">
+ <include name="**/model/*.class" />
+ </fileset>
+ </openjpac>
+ <echo message="Enhancement complete" />
</target>
</programlisting>
</example>
Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml?rev=1207658&r1=1207657&r2=1207658&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml Mon Nov 28 22:24:32 2011
@@ -242,6 +242,9 @@ The <filename>.class</filename> file of
<para>
If you do not supply any arguments to the enhancer, it will run on the classes
in your persistent class list (see <xref linkend="ref_guide_pc_pcclasses"/>).
+You must, however, supply the classpath you wish the enhancer to run with. This
+classpath must include, at minimum, the openjpa jar(s), persistence.xml and
+the target classes.
</para>
<para>
You can run the enhancer over classes that have already been enhanced, in which