mirror of https://github.com/apache/openjpa.git
OPENJPA-302: Update user manual for PCEnhancer usage. Patch contributed by Jacob Nowosatka.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1207658 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c3d9750f74
commit
76cd9dfe91
|
@ -236,7 +236,9 @@ files that should be processed. You can specify <filename>.java</filename> or
|
||||||
<filename>.class</filename> files. If you do not specify any files, the task
|
<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
|
will run on the classes listed in your <filename>persistence.xml</filename> or
|
||||||
<link linkend="openjpa.MetaDataFactory"><literal>
|
<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>
|
||||||
<para>
|
<para>
|
||||||
Following is an example of using the enhancer task in a <filename>build.xml
|
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 enhancer task in a <filename>build.xml
|
||||||
Invoking the Enhancer from Ant
|
Invoking the Enhancer from Ant
|
||||||
</title>
|
</title>
|
||||||
<programlisting>
|
<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"/>
|
|
||||||
|
|
||||||
<!-- invoke enhancer on all .java files below the model directory -->
|
<target name="enhance">
|
||||||
<openjpac>
|
<!-- Define the classpath to include the necessary files. -->
|
||||||
<fileset dir=".">
|
<!-- ex. openjpa jars, persistence.xml, orm.xml, and target classes -->
|
||||||
<include name="**/model/*.java" />
|
<path id="jpa.enhancement.classpath">
|
||||||
</fileset>
|
<!-- Assuming persistence.xml/orm.xml are in resources/META-INF -->
|
||||||
</openjpac>
|
<pathelement location="resources/" />
|
||||||
|
|
||||||
|
<!-- 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>
|
</target>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
|
@ -242,6 +242,9 @@ The <filename>.class</filename> file of a class.
|
||||||
<para>
|
<para>
|
||||||
If you do not supply any arguments to the enhancer, it will run on the classes
|
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"/>).
|
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>
|
||||||
<para>
|
<para>
|
||||||
You can run the enhancer over classes that have already been enhanced, in which
|
You can run the enhancer over classes that have already been enhanced, in which
|
||||||
|
|
Loading…
Reference in New Issue