Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 39265 invoked from network); 28 Jul 2009 16:38:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jul 2009 16:38:21 -0000 Received: (qmail 15293 invoked by uid 500); 28 Jul 2009 16:39:39 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 15283 invoked by uid 99); 28 Jul 2009 16:39:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jul 2009 16:39:39 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jul 2009 16:39:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EB4E0234C051 for ; Tue, 28 Jul 2009 09:39:14 -0700 (PDT) Message-ID: <450350296.1248799154962.JavaMail.jira@brutus> Date: Tue, 28 Jul 2009 09:39:14 -0700 (PDT) From: "Craig Russell (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Commented: (JDO-637) JDOQL : Enhance the JDOQL with JOIN and ALIAS features In-Reply-To: <990926081.1248777554877.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JDO-637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736129#action_12736129 ] Craig Russell commented on JDO-637: ----------------------------------- +1 to what Andy says. Simple cases don't even need any special syntax. The first example can be written as SELECT this.x, this,y, this.b.z FROM package.A where this.b != null. Additionally, JDOQL already has the capability of joining persistent classes, using the variable syntax described in 14.6.5. The variables allow joining based on persistent fields that describe the relationships. Inner versus outer joins are distinguished based on whether the reference is null or not. The default for JDOQL is "outer join" semantics. If you want "inner join" semantics, disallow null values. For example, you can join Employee and Department even if an Employee has no Department, but you can restrict Employees to those with Department references by using e.dept != null in the query. > JDOQL : Enhance the JDOQL with JOIN and ALIAS features > ------------------------------------------------------- > > Key: JDO-637 > URL: https://issues.apache.org/jira/browse/JDO-637 > Project: JDO > Issue Type: New Feature > Components: api2 > Reporter: Eric SULTAN > > JOIN examples : > SELECT this.x, this,y, this.b.z FROM package.A JOIN this.b > SELECT this.x, this,y, this.b.z FROM package.A LEFT OUTER JOIN this.b > ALIAS examples : > SELECT alias1.x, alias1.y, alias1.b.z FROM package.A alias1 WHERE alias1.number > 10 > JOIN and ALIAS examples : > SELECT alias1.x, alias1.y, alias1.b.z FROM package.A alias1 LEFT OUTER JOIN alias1.b WHERE alias1.number > 10 > SELECT alias1.x, alias1.y, alias2.z FROM package.A alias1 LEFT OUTER JOIN alias1.b alias2 WHERE alias1.number > 10 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.