Added: websites/production/openjpa/content/builds/2.4.2/apache-openjpa/docs/ref_guide_mapping_ext.html ============================================================================== --- websites/production/openjpa/content/builds/2.4.2/apache-openjpa/docs/ref_guide_mapping_ext.html (added) +++ websites/production/openjpa/content/builds/2.4.2/apache-openjpa/docs/ref_guide_mapping_ext.html Fri Jan 6 19:19:20 2017 @@ -0,0 +1,263 @@ +<html><head> + <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> + <title>9. Mapping Extensions</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 2.4 User's Guide"><link rel="up" href="ref_guide_mapping.html" title="Chapter 7. Mapping"><link rel="prev" href="ref_guide_mapping_limits.html" title="8. Mapping Limitations"><link rel="next" href="ref_guide_mapping_custom.html" title="10. Custom Mappings"></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">9. + Mapping Extensions + </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_mapping_limits.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_custom.html">Next</a></td></tr></table><hr></div><div class="section" id="ref_guide_mapping_ext"><div class="titlepage"><div><div><h2 class="title" style="clear: both">9. + Mapping Extensions + </h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="ref_guide_mapping_ext.html#ref_guide_mapping_ext_cls">9.1. + Class Extensions + </a></span></dt><dd><dl><dt><span class="section"><a href="ref_guide_mapping_ext.html#subclass-fetch-mode">9.1.1. + Subclass Fetch Mode + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#class-strategy">9.1.2. + Strategy + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#discriminator-strategy">9.1.3. + Discriminator Strategy + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#version-strategy">9.1.4. + Version Strategy + </a></span></dt></dl></dd><dt><span class="section"><a href="ref_guide_mapping_ext.html#ref_guide_mapping_ext_field">9.2. + Field Extensions + </a></span></dt><dd><dl><dt><span class="section"><a href="ref_guide_mapping_ext.html#eager-fetch-mode">9.2.1. + Eager Fetch Mode + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#nonpolymorphic">9.2.2. + Nonpolymorphic + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#class-criteria">9.2.3. + Class Criteria + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#strategy">9.2.4. + Strategy + </a></span></dt></dl></dd></dl></div> + + <p> +Mapping extensions allow you to access OpenJPA-specific functionality from your +mappings. Note that all extensions below are specific to mappings. If you store +your mappings separately from your persistence metadata, these extensions must +be specified along with the mapping information, not the persistence metadata +information. + </p> + <div class="section" id="ref_guide_mapping_ext_cls"><div class="titlepage"><div><div><h3 class="title">9.1. + Class Extensions + </h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="ref_guide_mapping_ext.html#subclass-fetch-mode">9.1.1. + Subclass Fetch Mode + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#class-strategy">9.1.2. + Strategy + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#discriminator-strategy">9.1.3. + Discriminator Strategy + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#version-strategy">9.1.4. + Version Strategy + </a></span></dt></dl></div> + + <p> +OpenJPA recognizes the following class extensions. + </p> + <div class="section" id="subclass-fetch-mode"><div class="titlepage"><div><div><h4 class="title">9.1.1. + Subclass Fetch Mode + </h4></div></div></div> + + <a class="indexterm" name="d5e14924"></a> + <p> +This extension specifies how to eagerly fetch subclass state. It overrides the +global <a class="link" href="ref_guide_conf_jdbc.html#openjpa.jdbc.SubclassFetchMode" title="6.16. openjpa.jdbc.SubclassFetchMode"><code class="literal"> +openjpa.jdbc.SubclassFetchMode</code></a> property. Set the OpenJPA +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/SubclassFetchMode.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.SubclassFetchMode</code> +</a> annotation to a value from the +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/FetchMode.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.FetchMode</code> +</a> enum: <code class="literal">JOIN</code>, <code class="literal">PARALLEL</code>, or +<code class="literal">NONE</code>. See <a class="xref" href="ref_guide_perfpack_eager.html" title="8. Eager Fetching">Section 8, “ + Eager Fetching + ”</a> + for a discussion of eager fetching. + </p> + </div> + <div class="section" id="class-strategy"><div class="titlepage"><div><div><h4 class="title">9.1.2. + Strategy + </h4></div></div></div> + + <a class="indexterm" name="d5e14942"></a> + <p> +The <a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/Strategy.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.Strategy</code></a> +class annotation allows you to specify a custom mapping strategy for your class. +See <a class="xref" href="ref_guide_mapping_custom.html" title="10. Custom Mappings">Section 10, “ + Custom Mappings + ”</a> for information on custom +mappings. + </p> + </div> + <div class="section" id="discriminator-strategy"><div class="titlepage"><div><div><h4 class="title">9.1.3. + Discriminator Strategy + </h4></div></div></div> + + <a class="indexterm" name="d5e14953"></a> + <p> +The +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/DiscriminatorStrategy.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.DiscriminatorStrategy</code> +</a> class annotation allows you to specify a custom discriminator strategy. +See <a class="xref" href="ref_guide_mapping_custom.html" title="10. Custom Mappings">Section 10, “ + Custom Mappings + ”</a> for information on custom +mappings. + </p> + </div> + <div class="section" id="version-strategy"><div class="titlepage"><div><div><h4 class="title">9.1.4. + Version Strategy + </h4></div></div></div> + + <a class="indexterm" name="d5e14964"></a> + <p> +The +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/VersionStrategy.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.VersionStrategy</code> +</a> class annotation allows you to specify a custom version strategy. See +<a class="xref" href="ref_guide_mapping_custom.html" title="10. Custom Mappings">Section 10, “ + Custom Mappings + ”</a> for information on custom +mappings. + </p> + </div> + </div> + <div class="section" id="ref_guide_mapping_ext_field"><div class="titlepage"><div><div><h3 class="title">9.2. + Field Extensions + </h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="ref_guide_mapping_ext.html#eager-fetch-mode">9.2.1. + Eager Fetch Mode + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#nonpolymorphic">9.2.2. + Nonpolymorphic + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#class-criteria">9.2.3. + Class Criteria + </a></span></dt><dt><span class="section"><a href="ref_guide_mapping_ext.html#strategy">9.2.4. + Strategy + </a></span></dt></dl></div> + + <p> +OpenJPA recognizes the following field extensions. + </p> + <div class="section" id="eager-fetch-mode"><div class="titlepage"><div><div><h4 class="title">9.2.1. + Eager Fetch Mode + </h4></div></div></div> + + <a class="indexterm" name="d5e14978"></a> + <p> +This extension specifies how to eagerly fetch related objects. It overrides the +global <a class="link" href="ref_guide_conf_jdbc.html#openjpa.jdbc.EagerFetchMode" title="6.4. openjpa.jdbc.EagerFetchMode"><code class="literal"> +openjpa.jdbc.EagerFetchMode</code></a> property. Set the OpenJPA +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/EagerFetchMode.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.EagerFetchMode</code> +</a> annotation to a value from the +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/FetchMode.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.FetchMode</code> +</a> enum: <code class="literal">JOIN</code>, <code class="literal">PARALLEL</code>, or +<code class="literal">NONE</code>. See <a class="xref" href="ref_guide_perfpack_eager.html" title="8. Eager Fetching">Section 8, “ + Eager Fetching + ”</a> + for a discussion of eager fetching. + </p> + </div> + <div class="section" id="nonpolymorphic"><div class="titlepage"><div><div><h4 class="title">9.2.2. + Nonpolymorphic + </h4></div></div></div> + + <a class="indexterm" name="d5e14996"></a> + <p> +All fields in Java are polymorphic. If you declare a field of type <code class="literal">T +</code>, you can assign any subclass of <code class="literal">T</code> to the field as +well. This is very convenient, but can make relation traversal very inefficient +under some inheritance strategies. It can even make querying across the field +impossible. Often, you know that certain fields do not need to be entirely +polymorphic. By telling OpenJPA about such fields, you can improve the +efficiency of your relations. + </p> + <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3> + <p> +OpenJPA also includes the <code class="literal">type</code> metadata extension for +narrowing the declared type of a field. See <a class="xref" href="ref_guide_meta_ext.html#type" title="4.2.6. Type">Section 4.2.6, “ + Type + ”</a>. + </p> + </div> + <p> +OpenJPA defines the following extensions for nonpolymorphic values: + </p> + <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> + <p> +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/Nonpolymorphic.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.Nonpolymorphic</code> +</a> + </p> + </li><li class="listitem"> + <p> +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/ElementNonpolymorphic.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.ElementNonpolymorphic</code> +</a> + </p> + </li></ul></div> + <p> +The value of these extensions is a constant from the +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/NonpolymorphicType.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.NonpolymorphicType</code> +</a> enumeration. The default value, <code class="literal">EXACT</code>, indicates +that the relation will always be of the exact declared type. A value of +<code class="literal">JOINABLE</code>, on the other hand, means that the relation might +be to any joinable subclass of the declared type. This value only excludes +table-per-class subclasses. + </p> + </div> + <div class="section" id="class-criteria"><div class="titlepage"><div><div><h4 class="title">9.2.3. + Class Criteria + </h4></div></div></div> + + <a class="indexterm" name="d5e15024"></a> + <a class="indexterm" name="d5e15029"></a> + <p> +This family of boolean extensions determines whether OpenJPA will use the +expected class of related objects as criteria in the SQL it issues to load a +relation field. Typically, this is not needed. The foreign key values uniquely +identify the record for the related object. Under some rare mappings, however, +you may need to consider both foreign key values and the expected class of the +related object - for example, if you have an inverse relation that shares the +foreign key with another inverse relation to an object of a different subclass. +In these cases, set the proper class criteria extension to <code class="literal">true +</code> to force OpenJPA to append class criteria to its select SQL. + </p> + <p> +OpenJPA defines the following class criteria annotations for field relations and +array or collection element relations, respectively: + </p> + <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> + <p> +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/ClassCriteria.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.ClassCriteria</code></a> + </p> + </li><li class="listitem"> + <p> +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/ElementClassCriteria.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.ElementClassCriteria</code> +</a> + </p> + </li></ul></div> + </div> + <div class="section" id="strategy"><div class="titlepage"><div><div><h4 class="title">9.2.4. + Strategy + </h4></div></div></div> + + <a class="indexterm" name="d5e15046"></a> + <p> +OpenJPA's +<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/jdbc/Strategy.html" target="_top"> +<code class="classname">org.apache.openjpa.persistence.jdbc.Strategy</code></a> +extension allows you to specify a custom mapping +strategy or value handler for a field. See +<a class="xref" href="ref_guide_mapping_custom.html" title="10. Custom Mappings">Section 10, “ + Custom Mappings + ”</a> for information on custom +mappings. + </p> + </div> + </div> + </div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_mapping_limits.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_custom.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8. + Mapping Limitations + </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 10. + Custom Mappings + </td></tr></table></div></body></html> \ No newline at end of file
Added: websites/production/openjpa/content/builds/2.4.2/apache-openjpa/docs/ref_guide_mapping_factory.html ============================================================================== --- websites/production/openjpa/content/builds/2.4.2/apache-openjpa/docs/ref_guide_mapping_factory.html (added) +++ websites/production/openjpa/content/builds/2.4.2/apache-openjpa/docs/ref_guide_mapping_factory.html Fri Jan 6 19:19:20 2017 @@ -0,0 +1,56 @@ +<html><head> + <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> + <title>5. 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 2.4 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" id="ref_guide_mapping_factory"><div class="titlepage"><div><div><h2 class="title" style="clear: both">5. + Mapping Factory + </h2></div></div></div> + + <a class="indexterm" name="d5e14173"></a> + <a class="indexterm" name="d5e14175"></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. 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 class="link" 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 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 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> \ No newline at end of file
