From commits-return-6581-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed May 12 21:22:59 2010 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 20853 invoked from network); 12 May 2010 21:22:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 May 2010 21:22:59 -0000 Received: (qmail 3010 invoked by uid 500); 12 May 2010 21:22:59 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 2993 invoked by uid 500); 12 May 2010 21:22:59 -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 2986 invoked by uid 99); 12 May 2010 21:22:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 May 2010 21:22:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 May 2010 21:22:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 65D16238899C; Wed, 12 May 2010 21:22:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r943695 - /openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml Date: Wed, 12 May 2010 21:22:35 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100512212235.65D16238899C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed May 12 21:22:33 2010 New Revision: 943695 URL: http://svn.apache.org/viewvc?rev=943695&view=rev Log: OPENJPA-1663,OPENJPA-1664: document Query/Finder Target Policy. Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml?rev=943695&r1=943694&r2=943695&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml Wed May 12 21:22:33 2010 @@ -19,7 +19,7 @@ --> - Distributed Persistence + Slice: Distributed Persistence The standard JPA runtime environment works with a single @@ -113,7 +113,7 @@ However, the application can target the query only to a subset of slices by setting hint on javax.persistence.Query. The hint key is openjpa.hint.slice.Target and - hint value is a comma-separated list of slice identifiers. The following + hint value is an array of slice identifiers. The following example shows how to target a query only to a pair of slices with logical identifier "One" and "Two". @@ -122,7 +122,7 @@ em.getTransaction().begin(); String hint = "openjpa.hint.slice.Target"; Query query = em.createQuery("SELECT p FROM PObject") - .setHint(hint, "One, Two"); + .setHint(hint, new String[]{"One", "Two"}); List result = query.getResultList(); // verify that each instance is originating from the hinted slices for (Object pc : result) { @@ -132,6 +132,28 @@ ]]> + + + To confine queries to a subset of slices via setting query hints can be considered + intrusive to existing application. The alternative means of targeting queries is to + a configure a <Query Target Policy. This policy is configured + via plug-in property openjpa.slice.QueryTargetPolicy. The + plug-in property is fully-qualified class name an implementation + for org.apache.openjpa.slice.QueryTargetPolicy interface. + This interface contract allows an user application to target a query select a subset + of slices based on the query and its bound parameters. The query target policy is consulted + only when no explicit target hint is set on the query. By default, the policy + executes a query on all available slices. + + + + A similar policy interface org.apache.openjpa.slice.FinderTargetPolicy + is available to target queries that originate from find() + by primary key. This finder target policy is consulted + only when no explicit target hint is set on the current fetch plan. By default, the policy + executes a query on all available slices to find an instance by its primary key. + To confine queries to a subset of slices via setting query hints can be considered +
Data Distribution