blob: 44b95f5778bbacbfb63f6f42ec8dab876f9673cf [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia Site Renderer 1.8.1 from target/generated-site/xdoc/test-enhance-mojo.xml at 06 Sep 2020 22:02 CEST -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>OpenJPA Maven Plugin &#x2013; openjpa:test-enhance</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta http-equiv="Content-Language" content="en" />
</head>
<body class="composite">
<div id="banner">
<div id="bannerLeft">
OpenJPA
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<span id="publishDate">Last Published: 06 Sep 2020 22:02 CEST</span>
&nbsp;| <span id="projectVersion">Version: 3.1.3-SNAPSHOT</span>
</div>
<div class="xright"> </div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Overview</h5>
<ul>
<li class="none"><a href="index.html" title="Introduction">Introduction</a></li>
<li class="none"><a href="usage.html" title="Usage">Usage</a></li>
<li class="none"><a href="plugin-info.html" title="Goals">Goals</a></li>
</ul>
<h5>Examples</h5>
<ul>
<li class="none"><a href="examples/enhance.html" title="Enhance">Enhance</a></li>
<li class="none"><a href="examples/sql.html" title="SQL">SQL</a></li>
<li class="none"><a href="examples/schema.html" title="Schema">Schema</a></li>
<li class="none"><a href="examples/testenhance.html" title="TestEnhance">TestEnhance</a></li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="section">
<h2><a name="openjpa:test-enhance"></a>openjpa:test-enhance</h2>
<p><b>Full name</b>:</p>
<p>org.apache.openjpa:openjpa-maven-plugin:3.1.3-SNAPSHOT:test-enhance</p>
<p><b>Description</b>:</p>
<div>Processes Application model test classes and enhances them by
running OpenJPA Enhancer tool.</div>
<p><b>Attributes</b>:</p>
<ul>
<li>Requires a Maven project to be executed.</li>
<li>Requires dependency resolution of artifacts in scope: <tt>test</tt>.</li>
<li>Since version: <tt>1.1</tt>.</li>
<li>Binds by default to the <a class="externalLink" href="http://maven.apache.org/ref/current/maven-core/lifecycles.html">lifecycle phase</a>: <tt>process-test-classes</tt>.</li>
</ul>
<div class="section">
<h3><a name="Required_Parameters"></a>Required Parameters</h3>
<table class="bodyTable" border="0">
<tr class="a">
<th>Name</th>
<th>Type</th>
<th>Since</th>
<th>Description</th>
</tr>
<tr class="b">
<td><tt><a href="#classes">&lt;classes&gt;</a></tt></td>
<td><tt>File</tt></td>
<td><tt>1.1</tt></td>
<td>Location where <tt>persistence-enabled</tt> classes are
located.<br /><b>Default value is</b>: <tt>${project.build.outputDirectory}</tt>.<br /><b>User property is</b>: <tt>openjpa.classes</tt>.<br /></td>
</tr>
<tr class="a">
<td><tt><a href="#forceMojoExecution">&lt;forceMojoExecution&gt;</a></tt></td>
<td><tt>boolean</tt></td>
<td><tt>1.1</tt></td>
<td>Setting this parameter to <tt>true</tt> will force the
execution of this mojo, even if it would get skipped usually.<br /><b>Default value is</b>: <tt>false</tt>.<br /><b>User property is</b>: <tt>forceOpenJpaExecution</tt>.<br /></td>
</tr>
<tr class="b">
<td><tt><a href="#workDir">&lt;workDir&gt;</a></tt></td>
<td><tt>File</tt></td>
<td><tt>1.1</tt></td>
<td>The working directory for putting persistence.xml and other stuff
into if we need to.<br /><b>Default value is</b>: <tt>${project.build.directory}/openjpa-work</tt>.<br /><b>User property is</b>: <tt>openjpa.workdir</tt>.<br /></td>
</tr>
</table>
</div>
<div class="section">
<h3><a name="Optional_Parameters"></a>Optional Parameters</h3>
<table class="bodyTable" border="0">
<tr class="a">
<th>Name</th>
<th>Type</th>
<th>Since</th>
<th>Description</th>
</tr>
<tr class="b">
<td><tt><a href="#addDefaultConstructor">&lt;addDefaultConstructor&gt;</a></tt></td>
<td><tt>boolean</tt></td>
<td><tt>1.1</tt></td>
<td>The JPA spec requires that all persistent classes define a no-arg
constructor. This flag tells the enhancer whether to add a
protected no-arg constructor to any persistent classes that don't
already have one.<br /><b>Default value is</b>: <tt>true</tt>.<br /></td>
</tr>
<tr class="a">
<td><tt><a href="#connectionDriverName">&lt;connectionDriverName&gt;</a></tt></td>
<td><tt>String</tt></td>
<td><tt>1.1</tt></td>
<td>
<p>This setting can be used to override any
openjpa.ConnectionDriverName set in the persistence.xml. It can
also be used if the persistence.xml contains no connection
information at all.</p>
<p>Sample:</p>
<div>
<pre>
&lt;connectionDriverName&gt;com.mchange.v2.c3p0.ComboPooledDataSource&lt;/connectionDriverName&gt;
</pre></div>
This is most times used in conjunction with
<tt>connectionProperties</tt>.<br /></td>
</tr>
<tr class="b">
<td><tt><a href="#connectionProperties">&lt;connectionProperties&gt;</a></tt></td>
<td><tt>String</tt></td>
<td><tt>1.1</tt></td>
<td>
<p>Used to define the credentials or any other connection
properties.</p>
Sample:
<div>
<pre>
&lt;connectionProperties&gt;
driverClass=com.mysql.jdbc.Driver,
jdbcUrl=jdbc:mysql://localhost/mydatabase,
user=root,
password=,
minPoolSize=5,
acquireRetryAttempts=3,
maxPoolSize=20
&lt;/connectionProperties&gt;
</pre></div>
This is most times used in conjunction with
<tt>connectionDriverName</tt>.<br /></td>
</tr>
<tr class="a">
<td><tt><a href="#enforcePropertyRestrictions">&lt;enforcePropertyRestrictions&gt;</a></tt></td>
<td><tt>boolean</tt></td>
<td><tt>1.1</tt></td>
<td>Whether to throw an exception when it appears that a property
access entity is not obeying the restrictions placed on property
access.<br /><b>Default value is</b>: <tt>false</tt>.<br /></td>
</tr>
<tr class="b">
<td><tt><a href="#excludes">&lt;excludes&gt;</a></tt></td>
<td><tt>String</tt></td>
<td><tt>1.1</tt></td>
<td>Comma separated list of excludes to scan searchDir to pass to the
jobs. This option may be used to stop OpenJPA tasks from scanning
non-JPA classes (which usually leads to warnings such as &quot;Type xxx
has no metadata&quot;)<br /></td>
</tr>
<tr class="a">
<td><tt><a href="#includes">&lt;includes&gt;</a></tt></td>
<td><tt>String</tt></td>
<td><tt>1.1</tt></td>
<td>Comma separated list of includes to scan searchDir to pass to the
jobs. This may be used to restrict the OpenJPA tasks to e.g. a
single package which contains all the entities.<br /><b>Default value is</b>: <tt>**/*.class</tt>.<br /></td>
</tr>
<tr class="b">
<td><tt><a href="#persistenceUnitName">&lt;persistenceUnitName&gt;</a></tt></td>
<td><tt>String</tt></td>
<td><tt>1.1</tt></td>
<td>An optional PersistenceUnit name. If not specified then OpenJPA
will run against 'all anchors'. Means it will use all
persistenceunits of all persistence.xml files it finds.<br /><b>Default value is</b>: <tt>${openjpa.persistenceUnitName}</tt>.<br /></td>
</tr>
<tr class="a">
<td><tt><a href="#persistenceXmlFile">&lt;persistenceXmlFile&gt;</a></tt></td>
<td><tt>String</tt></td>
<td><tt>1.1</tt></td>
<td>Used if a non-default file location for the persistence.xml should
be used If not specified, the default one in
META-INF/persistence.xml will be used. Since openjpa-2.3.0 this can
also be a resource location. In prior releases it was only possible
to specify a file location.<br /></td>
</tr>
<tr class="b">
<td><tt><a href="#skip">&lt;skip&gt;</a></tt></td>
<td><tt>boolean</tt></td>
<td><tt>1.0</tt></td>
<td>When <tt>true</tt>, skip the execution.<br /><b>Default value is</b>: <tt>false</tt>.<br /></td>
</tr>
<tr class="a">
<td><tt><a href="#tmpClassLoader">&lt;tmpClassLoader&gt;</a></tt></td>
<td><tt>boolean</tt></td>
<td><tt>1.1</tt></td>
<td>Tell the PCEnhancer to use a temporary classloader for enhancement.
If you enable this feature, then no depending artifacts from the
classpath will be used! Please note that you have to disable the
tmpClassLoader for some cases in OpenJPA-1.2.1 due to an extended
parsing strategy.<br /><b>Default value is</b>: <tt>false</tt>.<br /></td>
</tr>
<tr class="b">
<td><tt><a href="#toolProperties">&lt;toolProperties&gt;</a></tt></td>
<td><tt>Properties</tt></td>
<td><tt>1.1</tt></td>
<td>Additional properties passed to the OpenJPA tools.<br /></td>
</tr>
</table>
</div>
<div class="section">
<h3><a name="Parameter_Details"></a>Parameter Details</h3>
<div class="section">
<h4><a name="a.3CaddDefaultConstructor.3E"></a><b><a name="addDefaultConstructor">&lt;addDefaultConstructor&gt;</a></b></h4>
<div>The JPA spec requires that all persistent classes define a no-arg
constructor. This flag tells the enhancer whether to add a
protected no-arg constructor to any persistent classes that don't
already have one.</div>
<ul>
<li><b>Type</b>: <tt>boolean</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
<li><b>Default</b>: <tt>true</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3Cclasses.3E"></a><b><a name="classes">&lt;classes&gt;</a></b></h4>
<div>Location where <tt>persistence-enabled</tt> classes are
located.</div>
<ul>
<li><b>Type</b>: <tt>java.io.File</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>Yes</tt></li>
<li><b>User Property</b>: <tt>openjpa.classes</tt></li>
<li><b>Default</b>: <tt>${project.build.outputDirectory}</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3CconnectionDriverName.3E"></a><b><a name="connectionDriverName">&lt;connectionDriverName&gt;</a></b></h4>
<div>
<p>This setting can be used to override any
openjpa.ConnectionDriverName set in the persistence.xml. It can
also be used if the persistence.xml contains no connection
information at all.</p>
<p>Sample:</p>
<div>
<pre>
&lt;connectionDriverName&gt;com.mchange.v2.c3p0.ComboPooledDataSource&lt;/connectionDriverName&gt;
</pre></div>
This is most times used in conjunction with
<tt>connectionProperties</tt>.</div>
<ul>
<li><b>Type</b>: <tt>java.lang.String</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3CconnectionProperties.3E"></a><b><a name="connectionProperties">&lt;connectionProperties&gt;</a></b></h4>
<div>
<p>Used to define the credentials or any other connection
properties.</p>
Sample:
<div>
<pre>
&lt;connectionProperties&gt;
driverClass=com.mysql.jdbc.Driver,
jdbcUrl=jdbc:mysql://localhost/mydatabase,
user=root,
password=,
minPoolSize=5,
acquireRetryAttempts=3,
maxPoolSize=20
&lt;/connectionProperties&gt;
</pre></div>
This is most times used in conjunction with
<tt>connectionDriverName</tt>.</div>
<ul>
<li><b>Type</b>: <tt>java.lang.String</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3CenforcePropertyRestrictions.3E"></a><b><a name="enforcePropertyRestrictions">&lt;enforcePropertyRestrictions&gt;</a></b></h4>
<div>Whether to throw an exception when it appears that a property
access entity is not obeying the restrictions placed on property
access.</div>
<ul>
<li><b>Type</b>: <tt>boolean</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
<li><b>Default</b>: <tt>false</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3Cexcludes.3E"></a><b><a name="excludes">&lt;excludes&gt;</a></b></h4>
<div>Comma separated list of excludes to scan searchDir to pass to the
jobs. This option may be used to stop OpenJPA tasks from scanning
non-JPA classes (which usually leads to warnings such as &quot;Type xxx
has no metadata&quot;)</div>
<ul>
<li><b>Type</b>: <tt>java.lang.String</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3CforceMojoExecution.3E"></a><b><a name="forceMojoExecution">&lt;forceMojoExecution&gt;</a></b></h4>
<div>Setting this parameter to <tt>true</tt> will force the
execution of this mojo, even if it would get skipped usually.</div>
<ul>
<li><b>Type</b>: <tt>boolean</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>Yes</tt></li>
<li><b>User Property</b>: <tt>forceOpenJpaExecution</tt></li>
<li><b>Default</b>: <tt>false</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3Cincludes.3E"></a><b><a name="includes">&lt;includes&gt;</a></b></h4>
<div>Comma separated list of includes to scan searchDir to pass to the
jobs. This may be used to restrict the OpenJPA tasks to e.g. a
single package which contains all the entities.</div>
<ul>
<li><b>Type</b>: <tt>java.lang.String</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
<li><b>Default</b>: <tt>**/*.class</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3CpersistenceUnitName.3E"></a><b><a name="persistenceUnitName">&lt;persistenceUnitName&gt;</a></b></h4>
<div>An optional PersistenceUnit name. If not specified then OpenJPA
will run against 'all anchors'. Means it will use all
persistenceunits of all persistence.xml files it finds.</div>
<ul>
<li><b>Type</b>: <tt>java.lang.String</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
<li><b>Default</b>: <tt>${openjpa.persistenceUnitName}</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3CpersistenceXmlFile.3E"></a><b><a name="persistenceXmlFile">&lt;persistenceXmlFile&gt;</a></b></h4>
<div>Used if a non-default file location for the persistence.xml should
be used If not specified, the default one in
META-INF/persistence.xml will be used. Since openjpa-2.3.0 this can
also be a resource location. In prior releases it was only possible
to specify a file location.</div>
<ul>
<li><b>Type</b>: <tt>java.lang.String</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3Cskip.3E"></a><b><a name="skip">&lt;skip&gt;</a></b></h4>
<div>When <tt>true</tt>, skip the execution.</div>
<ul>
<li><b>Type</b>: <tt>boolean</tt></li>
<li><b>Since</b>: <tt>1.0</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
<li><b>Default</b>: <tt>false</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3CtmpClassLoader.3E"></a><b><a name="tmpClassLoader">&lt;tmpClassLoader&gt;</a></b></h4>
<div>Tell the PCEnhancer to use a temporary classloader for enhancement.
If you enable this feature, then no depending artifacts from the
classpath will be used! Please note that you have to disable the
tmpClassLoader for some cases in OpenJPA-1.2.1 due to an extended
parsing strategy.</div>
<ul>
<li><b>Type</b>: <tt>boolean</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
<li><b>Default</b>: <tt>false</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3CtoolProperties.3E"></a><b><a name="toolProperties">&lt;toolProperties&gt;</a></b></h4>
<div>Additional properties passed to the OpenJPA tools.</div>
<ul>
<li><b>Type</b>: <tt>java.util.Properties</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>No</tt></li>
</ul><hr /></div>
<div class="section">
<h4><a name="a.3CworkDir.3E"></a><b><a name="workDir">&lt;workDir&gt;</a></b></h4>
<div>The working directory for putting persistence.xml and other stuff
into if we need to.</div>
<ul>
<li><b>Type</b>: <tt>java.io.File</tt></li>
<li><b>Since</b>: <tt>1.1</tt></li>
<li><b>Required</b>: <tt>Yes</tt></li>
<li><b>User Property</b>: <tt>openjpa.workdir</tt></li>
<li><b>Default</b>: <tt>${project.build.directory}/openjpa-work</tt></li>
</ul>
</div></div>
</div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
Copyright &#169; 2011&#x2013;2020 <a href="http://www.apache.org">Apache Software Foundation</a>.
All rights reserved. </div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>