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>
+
 &lt;target name="enhance"&gt;
-  &lt;!-- define the openjpac task; this can be done at the top of the    --&gt;
-  &lt;!-- build.xml file, so it will be available for all targets      --&gt;
-  &lt;taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask"/&gt;
+    &lt;!-- Define the classpath to include the necessary files. --&gt;
+    &lt;!-- ex. openjpa jars, persistence.xml, orm.xml, and target classes  --&gt;
+    &lt;path id="jpa.enhancement.classpath"&gt;
+        &lt;!-- Assuming persistence.xml/orm.xml are in resources/META-INF --&gt;
+        &lt;pathelement location="resources/" /&gt;
 
-  &lt;!-- invoke enhancer on all .java files below the model directory --&gt;
-  &lt;openjpac&gt;
-    &lt;fileset dir="."&gt;
-      &lt;include name="**/model/*.java" /&gt;
-    &lt;/fileset&gt;
-  &lt;/openjpac&gt;
+        &lt;!-- Location of the .class files --&gt;
+        &lt;pathelement location="bin/" /&gt;
+
+        &lt;!-- Add the openjpa jars --&gt;
+        &lt;fileset dir="."&gt;
+            &lt;include name="**/lib/*.jar" /&gt;
+        &lt;/fileset&gt;
+    &lt;/path&gt;
+
+
+    &lt;!-- define the openjpac task; this can be done at the top of the --&gt;
+    &lt;!-- build.xml file, so it will be available for all targets --&gt;
+    &lt;taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="jpa.enhancement.classpath" /&gt;
+
+    &lt;!-- invoke enhancer on all .class files below the model directory --&gt;
+    &lt;openjpac&gt;
+        &lt;classpath refid="jpa.enhancement.classpath" /&gt;
+        &lt;fileset dir="."&gt;
+            &lt;include name="**/model/*.class" /&gt;
+        &lt;/fileset&gt;
+    &lt;/openjpac&gt;
+    &lt;echo message="Enhancement complete" /&gt;
 &lt;/target&gt;
 </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