|  | <html><head> | 
|  | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | 
|  | <title>2.  Runtime Configuration</title><link rel="stylesheet" href="css/docbook.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="manual.html" title="Apache OpenJPA User's Guide"><link rel="up" href="ref_guide_conf.html" title="Chapter 2.  Configuration"><link rel="prev" href="ref_guide_conf.html" title="Chapter 2.  Configuration"><link rel="next" href="ref_guide_conf_devtools.html" title="3.  Command Line Configuration"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2.  | 
|  | Runtime Configuration | 
|  | </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_conf.html">Prev</a> </td><th width="60%" align="center">Chapter 2.  | 
|  | Configuration | 
|  | </th><td width="20%" align="right"> <a accesskey="n" href="ref_guide_conf_devtools.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ref_guide_conf_specify"></a>2.  | 
|  | Runtime Configuration | 
|  | </h2></div></div></div><a class="indexterm" name="d0e12120"></a><p> | 
|  | The OpenJPA runtime includes a comprehensive system of configuration defaults | 
|  | and overrides: | 
|  | </p><div class="itemizedlist"><ul type="disc"><li><p> | 
|  | <a class="indexterm" name="d0e12131"></a> | 
|  | OpenJPA first looks for an optional <code class="filename">openjpa.xml</code> resource. | 
|  | OpenJPA searches for this resource in each top-level directory of your <code class="literal"> | 
|  | CLASSPATH</code>. OpenJPA will also find the resource if you place it within | 
|  | a <code class="filename">META-INF</code> directory in any top-level directory of the | 
|  | <code class="literal">CLASSPATH</code>. The <code class="filename">openjpa.xml</code> resource | 
|  | contains property settings in <a href="jpa_overview_persistence.html#jpa_overview_persistence_xml" title="1.  persistence.xml"> | 
|  | JPA's XML format</a>. | 
|  | </p></li><li><p> | 
|  | You can customize the name or location of the above resource by specifying the | 
|  | correct resource path in the <code class="literal">openjpa.properties</code> System | 
|  | property. | 
|  | </p></li><li><p> | 
|  | You can override any value defined in the above resource by setting the System | 
|  | property of the same name to the desired value. | 
|  | </p></li><li><p> | 
|  | <a class="indexterm" name="d0e12165"></a> | 
|  | In JPA, the values in the standard <code class="filename"> META-INF/persistence.xml | 
|  | </code> bootstrapping file used by the | 
|  | <a href="jpa_overview_persistence.html" title="Chapter 6.  Persistence"><code class="classname">Persistence</code> | 
|  | </a> class at runtime override the values in the above resource, as well as | 
|  | any System property settings. The <code class="classname">Map</code> passed to | 
|  | <code class="methodname">Persistence.createEntityManagerFactory</code> at runtime also | 
|  | overrides previous settings, including properties defined in <code class="filename"> | 
|  | persistence.xml</code>. | 
|  | </p></li><li><p> | 
|  | When using JCA deployment the <code class="literal">config-property</code> values in your | 
|  | <code class="filename">ra.xml</code> file override other settings. | 
|  | </p></li><li><p> | 
|  | All OpenJPA command-line tools accept flags that allow you to specify the | 
|  | configuration resource to use, and to override any property. | 
|  | <a href="ref_guide_conf_devtools.html" title="3.  Command Line Configuration">Section 3, “ | 
|  | Command Line Configuration | 
|  | ”</a> describes these flags. | 
|  | </p></li></ul></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> | 
|  | Internally, the OpenJPA runtime environment and development | 
|  | tools manipulate property settings through a general | 
|  | <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/ResultObjectProvider/lib/conf/Configuration.html" target="_top"> | 
|  | <code class="classname">Configuration</code></a> interface, and in particular its | 
|  | <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/conf/OpenJPAConfiguration.html" target="_top"> | 
|  | <code class="classname">OpenJPAConfiguration</code></a> and | 
|  | <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/conf/JDBCConfiguration.html" target="_top"> | 
|  | <code class="classname">JDBCConfiguration</code></a> subclasses. For advanced | 
|  | customization, OpenJPA's extended runtime interfaces and its development tools | 
|  | allow you to access these interfaces directly. See the <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc" target="_top"> | 
|  | Javadoc</a> for details. | 
|  | </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_conf.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref_guide_conf.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ref_guide_conf_devtools.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2.  | 
|  | Configuration | 
|  |  </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 3.  | 
|  | Command Line Configuration | 
|  | </td></tr></table></div></body></html> |