| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>5. Mapping Factory</title><link rel="stylesheet" href="css/docbook.css" type="text/css"><base href="display"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="manual.html" title="Apache OpenJPA 2.1 User's Guide"><link rel="up" href="ref_guide_mapping.html" title="Chapter 7. Mapping"><link rel="prev" href="ref_guide_mapping_defaults.html" title="4. Mapping Defaults"><link rel="next" href="ref_guide_mapping_notes_nonstdjoins.html" title="6. 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. |
| Mapping Factory |
| </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_mapping_defaults.html">Prev</a> </td><th width="60%" align="center">Chapter 7. |
| Mapping |
| </th><td width="20%" align="right"> <a accesskey="n" href="ref_guide_mapping_notes_nonstdjoins.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_mapping_factory"></a>5. |
| Mapping Factory |
| </h2></div></div></div><a class="indexterm" name="d0e29468"></a><a class="indexterm" name="d0e29471"></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 href="ref_guide_meta.html#ref_guide_meta_factory" title="1. Metadata Factory">Section 1, “ |
| Metadata Factory |
| ”</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 href="ref_guide_conf_jdbc.html#openjpa.jdbc.MappingFactory" title="6.9. 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 type="disc"><li><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"><a name="ref_guide_mapping_factory_jpa"></a><p class="title"><b>Example 7.13. |
| 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"> |
| <property name="openjpa.MetaDataFactory" value="jpa"/> |
| </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> </td><td width="20%" align="center"><a accesskey="u" href="ref_guide_mapping.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ref_guide_mapping_notes_nonstdjoins.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4. |
| Mapping Defaults |
| </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 6. |
| Non-Standard Joins |
| </td></tr></table></div></body></html> |