mirror of
https://github.com/apache/openjpa.git
synced 2025-02-06 18:19:00 +00:00
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
|
||||
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 enhancer task in a <filename>build.xml
|
||||
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"/>
|
||||
|
||||
<!-- invoke enhancer on all .java files below the model directory -->
|
||||
<openjpac>
|
||||
<fileset dir=".">
|
||||
<include name="**/model/*.java" />
|
||||
</fileset>
|
||||
</openjpac>
|
||||
<target name="enhance">
|
||||
<!-- 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/" />
|
||||
|
||||
<!-- 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>
|
||||
|
@ -242,6 +242,9 @@ The <filename>.class</filename> file of a class.
|
||||
<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
|
||||
|
Loading…
x
Reference in New Issue
Block a user