Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 37841 invoked from network); 25 Aug 2008 19:59:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Aug 2008 19:59:02 -0000 Received: (qmail 18819 invoked by uid 500); 25 Aug 2008 19:59:00 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 18790 invoked by uid 500); 25 Aug 2008 19:59:00 -0000 Mailing-List: contact dev-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 dev@openjpa.apache.org Received: (qmail 18779 invoked by uid 99); 25 Aug 2008 19:59:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2008 12:59:00 -0700 X-ASF-Spam-Status: No, hits=-3.8 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.18.43.133] (HELO sca-es-mail-2.sun.com) (192.18.43.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2008 19:58:01 +0000 Received: from fe-sfbay-09.sun.com ([192.18.43.129]) by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m7PJwKLq028327 for ; Mon, 25 Aug 2008 12:58:31 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K66006019YJVB00@fe-sfbay-09.sun.com> (original mail from Craig.Russell@Sun.COM) for dev@openjpa.apache.org; Mon, 25 Aug 2008 12:58:20 -0700 (PDT) Received: from [10.1.40.232] ([208.51.67.170]) by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K66009W3A58C4C0@fe-sfbay-09.sun.com>; Mon, 25 Aug 2008 12:58:20 -0700 (PDT) Date: Mon, 25 Aug 2008 12:57:19 -0700 From: Craig L Russell Subject: Fetch configuration Sender: Craig.Russell@Sun.COM To: JDO Expert Group , Apache JDO project Cc: dev@openjpa.apache.org Message-id: <9ED7E5F9-46D9-4460-AB19-9C40673EEA0D@SUN.com> MIME-version: 1.0 X-Mailer: Apple Mail (2.926) Content-type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary=Apple-Mail-11-868871286 X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-11-868871286 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Please see this message posted on the openjpa list: http://n2.nabble.com/Fetch-Group-questions-tc534861.html One of the comments is particularly relevant to JDO: 2. http://openjpa.apache.org/docs/latest/manual/manual.html#ref_guide_fetch_impl says that "Even when a direct relation is not eagerly fetched, OpenJPA selects the foreign key columns and caches the values. This way when you do traverse the relation, OpenJPA can often find the related object in its cache, or at least avoid joins when loading the related object from the database." - that's very kind, but may be we have an Entity with lots of foreign key columns and I KNOW I only want a list showing a few attributes, and I KNOW that the direct relations won't be traversed (say because the Entites are detached, may be). Is there any way to configure OpenJPA to NOT eagerly fetch direct relations, unless they are explicitly part of the Fetch Group? Actually what I'd want is to be able to by default not include foreign key columns, but have a way to explicitly include them - which is not the same as having the field as part of the FetchGroup (that will lead to a JOIN, I may just want to control whether or not to selects the foreign key column). Currently we don't have the notion in JDO of fetching key values of relationships, just fetching the targets of these keys. Would it be useful to consider adding to the JDO specification the ability to specify fetching the keys for relationships and not the relationships themselves? This would probably include adding some metadata to fetch-group and to FetchGroup. One thing to kick around, is changing the meaning of recursion- depth==0 so changing: -1 recurse indefinitely 1 just fetch the target of this field n fetch the target and recurse n times 0 just fetch the identifier (foreign key value) for the field but not the field itself This is a "spare bit" that is currently not particularly useful, since the specified behavior is identical if "the member is not specified in the FetchGroup" and "the member is specified with a recursion-depth of 0". Craig Craig L Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:Craig.Russell@sun.com P.S. A good JDO? O, Gasp! --Apple-Mail-11-868871286 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGUDCCAwkw ggJyoAMCAQICECvOQSuIjHMvOZRC95BRg/wwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA3MTIxMDE1MjM1MVoXDTA4MTIwOTE1MjM1 MVowbDEQMA4GA1UEBBMHUnVzc2VsbDEUMBIGA1UEKhMLQ3JhaWcgTGFpcmQxHDAaBgNVBAMTE0Ny YWlnIExhaXJkIFJ1c3NlbGwxJDAiBgkqhkiG9w0BCQEWFUNyYWlnLlJ1c3NlbGxAU3VuLkNPTTCC ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKzqGlLUastboCRqc0iBoTz2ODcqpMpEyPUo nYtluchkSIoWzOW63AuoTczRt9sKfhwoK5mope+62B6Li06WJabm2UHqKAaNSuMHLsmyqvOdwbSt enY7/HxOSCMqVoyVBTRJc2M8feCSVgi7ptGq9cM+Maa64R1/p9zqaQNucceU/1uper90bWplsjAT rHgicgr9XJIQb6uYjhjlgxxnY/aispnCvLxMX+CiA2FWeeJTI7AiFlLwibTXYF4v12ToByvXtTiJ knuND8qpwhK3Wp0tL4ae8mZ0nlKjCuNnqh99ZyEyTFHZBfVx8WSWRXkY4qxCG/IDQUo7WUaefOQT 1mECAwEAAaMyMDAwIAYDVR0RBBkwF4EVQ3JhaWc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