blob: 3f20e9b21de58017166e15bafa1b301b9f96c223 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>5.&nbsp; Mapping Factory</title><base href="display"><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="manual.html" title="Apache OpenJPA 3.0 User's Guide"><link rel="up" href="ref_guide_mapping.html" title="Chapter&nbsp;7.&nbsp; Mapping"><link rel="prev" href="ref_guide_mapping_defaults.html" title="4.&nbsp; Mapping Defaults"><link rel="next" href="ref_guide_mapping_notes_nonstdjoins.html" title="6.&nbsp; Non-Standard Joins"></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">5.&nbsp;
Mapping Factory
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_mapping_defaults.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;7.&nbsp;
Mapping
</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ref_guide_mapping_notes_nonstdjoins.html">Next</a></td></tr></table><hr></div><div class="section" id="ref_guide_mapping_factory"><div class="titlepage"><div><div><h2 class="title" style="clear: both">5.&nbsp;
Mapping Factory
</h2></div></div></div>
<a class="indexterm" name="d5e14198"></a>
<a class="indexterm" name="d5e14200"></a>
<p>
An important decision in the object-relational mapping process is how and where
to store the data necessary to map your persistent classes to the database
schema.
</p>
<p>
<a class="xref" href="ref_guide_meta.html#ref_guide_meta_factory" title="1.&nbsp; Metadata Factory">Section&nbsp;1, &#8220;
Metadata Factory
&#8221;</a> introduced OpenJPA's <code class="classname">
MetaDataFactory</code> interface. OpenJPA uses this same interface to
abstract the storage and retrieval of mapping information. OpenJPA includes the
built-in mapping factories below, and you can create your own factory if you
have custom needs. You control which mapping factory OpenJPA uses with the
<a class="link" href="ref_guide_conf_jdbc.html#openjpa.jdbc.MappingFactory" title="6.9.&nbsp; openjpa.jdbc.MappingFactory"><code class="literal">
openjpa.jdbc.MappingFactory</code></a> configuration property.
</p>
<p>
The bundled mapping factories are:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<p>
<code class="literal">-</code>: Leaving the <code class="literal"> openjpa.jdbc.MappingFactory
</code> property unset allows your metadata factory to take over mappings as
well. If you are using the default <code class="literal">jpa</code> metadata factory,
OpenJPA will read mapping information from your annotations and
<code class="filename">orm.xml</code> when you leave the mapping factory unspecified.
</p>
</li></ul></div>
<div class="example" id="ref_guide_mapping_factory_jpa"><p class="title"><b>Example&nbsp;7.13.&nbsp;
Standard JPA Configuration
</b></p><div class="example-contents">
<p>
In the standard JPA configuration, the mapping factory is left unset.
</p>
<pre class="programlisting">
&lt;property name="openjpa.MetaDataFactory" value="jpa"/&gt;
</pre>
</div></div><br class="example-break">
</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_mapping_defaults.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ref_guide_mapping.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ref_guide_mapping_notes_nonstdjoins.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4.&nbsp;
Mapping Defaults
&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;6.&nbsp;
Non-Standard Joins
</td></tr></table></div></body></html>