Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 302BF200BF4 for ; Fri, 6 Jan 2017 20:19:31 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2EE04160B4F; Fri, 6 Jan 2017 19:19:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EA4B9160B68 for ; Fri, 6 Jan 2017 20:19:28 +0100 (CET) Received: (qmail 91681 invoked by uid 500); 6 Jan 2017 19:19:28 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 90876 invoked by uid 99); 6 Jan 2017 19:19:27 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2017 19:19:27 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id F3CD93A002C for ; Fri, 6 Jan 2017 19:19:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1004302 [34/41] - in /websites/production/openjpa/content/builds/2.4.2: ./ apache-openjpa/ apache-openjpa/docs/ apache-openjpa/docs/css/ apache-openjpa/docs/img/ Date: Fri, 06 Jan 2017 19:19:22 -0000 To: commits@openjpa.apache.org From: ilgrosso@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170106191925.F3CD93A002C@svn01-us-west.apache.org> archived-at: Fri, 06 Jan 2017 19:19:31 -0000 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 @@ + + + 9.  Mapping Extensions

9.  + Mapping Extensions +

+ +

+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. +

+

9.1.  + Class Extensions +

+ +

+OpenJPA recognizes the following class extensions. +

+

9.1.1.  + Subclass Fetch Mode +

+ + +

+This extension specifies how to eagerly fetch subclass state. It overrides the +global +openjpa.jdbc.SubclassFetchMode property. Set the OpenJPA + +org.apache.openjpa.persistence.jdbc.SubclassFetchMode + annotation to a value from the + +org.apache.openjpa.persistence.jdbc.FetchMode + enum: JOIN, PARALLEL, or +NONE. See Section 8, “ + Eager Fetching + ” + for a discussion of eager fetching. +

+
+

9.1.2.  + Strategy +

+ + +

+The +org.apache.openjpa.persistence.jdbc.Strategy +class annotation allows you to specify a custom mapping strategy for your class. +See Section 10, “ + Custom Mappings + ” for information on custom +mappings. +

+
+

9.1.3.  + Discriminator Strategy +

+ + +

+The + +org.apache.openjpa.persistence.jdbc.DiscriminatorStrategy + class annotation allows you to specify a custom discriminator strategy. +See Section 10, “ + Custom Mappings + ” for information on custom +mappings. +

+
+

9.1.4.  + Version Strategy +

+ + +

+The + +org.apache.openjpa.persistence.jdbc.VersionStrategy + class annotation allows you to specify a custom version strategy. See +Section 10, “ + Custom Mappings + ” for information on custom +mappings. +

+
+
+

9.2.  + Field Extensions +

+ +

+OpenJPA recognizes the following field extensions. +

+

9.2.1.  + Eager Fetch Mode +

+ + +

+This extension specifies how to eagerly fetch related objects. It overrides the +global +openjpa.jdbc.EagerFetchMode property. Set the OpenJPA + +org.apache.openjpa.persistence.jdbc.EagerFetchMode + annotation to a value from the + +org.apache.openjpa.persistence.jdbc.FetchMode + enum: JOIN, PARALLEL, or +NONE. See Section 8, “ + Eager Fetching + ” + for a discussion of eager fetching. +

+
+

9.2.2.  + Nonpolymorphic +

+ + +

+All fields in Java are polymorphic. If you declare a field of type T +, you can assign any subclass of T 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. +

+

Note

+

+OpenJPA also includes the type metadata extension for +narrowing the declared type of a field. See Section 4.2.6, “ + Type + ”. +

+
+

+OpenJPA defines the following extensions for nonpolymorphic values: +

+ +

+The value of these extensions is a constant from the + +org.apache.openjpa.persistence.jdbc.NonpolymorphicType + enumeration. The default value, EXACT, indicates +that the relation will always be of the exact declared type. A value of +JOINABLE, 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. +

+
+

9.2.3.  + Class Criteria +

+ + + +

+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 true + to force OpenJPA to append class criteria to its select SQL. +

+

+OpenJPA defines the following class criteria annotations for field relations and +array or collection element relations, respectively: +

+ +
+

9.2.4.  + Strategy +

+ + +

+OpenJPA's + +org.apache.openjpa.persistence.jdbc.Strategy +extension allows you to specify a custom mapping +strategy or value handler for a field. See +Section 10, “ + Custom Mappings + ” for information on custom +mappings. +

+
+
+
\ 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 @@ + + + 5.  Mapping Factory

5.  + Mapping Factory +

+ + + +

+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. +

+

+Section 1, “ + Metadata Factory + ” introduced OpenJPA's +MetaDataFactory 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 + +openjpa.jdbc.MappingFactory configuration property. +

+

+The bundled mapping factories are: +

+
  • +

    +-: Leaving the openjpa.jdbc.MappingFactory + property unset allows your metadata factory to take over mappings as +well. If you are using the default jpa metadata factory, +OpenJPA will read mapping information from your annotations and +orm.xml when you leave the mapping factory unspecified. +

    +
+

Example 7.13.  + Standard JPA Configuration +

+ +

+In the standard JPA configuration, the mapping factory is left unset. +

+
+<property name="openjpa.MetaDataFactory" value="jpa"/>
+
+

+
\ No newline at end of file