Return-Path: X-Original-To: apmail-db-jdo-dev-archive@www.apache.org Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BAC1511338 for ; Thu, 10 Jul 2014 19:41:04 +0000 (UTC) Received: (qmail 50675 invoked by uid 500); 10 Jul 2014 19:41:04 -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 50651 invoked by uid 99); 10 Jul 2014 19:41:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jul 2014 19:41:04 +0000 Date: Thu, 10 Jul 2014 19:41:04 +0000 (UTC) From: "Michael Bouschen (JIRA)" To: jdo-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (JDO-730) Creating the innerjoin without relationship between objects MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JDO-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14057845#comment-14057845 ] Michael Bouschen commented on JDO-730: -------------------------------------- JDOQL supports this kind of queries using a feature called unconstrained variables (see chapter 14.6.5 in the specification). Class1 is the class mapped to Table1 and Class2 is mapped to Table2. The query uses Class1 as the candidate class of the query and declares a variable b of type Class2. The variable b is not bound by a contains clause, so ths is called an unconstrained variable. Query q = pm.newQuery(Class1.class); q.setFilter("this.z == b.w"); q.setResult("this.x, b.y") q.declareVariables("com.xyz.Class2 b"); Collection result = (Collection )q.execute(); Here is the single-string version of the query: select this.x, b.y from com.xyz.Class1 where this.z == b.w variables com.xyz.Class2 b Hope this helps. > Creating the innerjoin without relationship between objects > ----------------------------------------------------------- > > Key: JDO-730 > URL: https://issues.apache.org/jira/browse/JDO-730 > Project: JDO > Issue Type: Wish > Components: api > Affects Versions: JDO 3.1-rc1 > Reporter: RaviRaja > Assignee: Michael Bouschen > Fix For: JDO 3.1 > > > Cannot make innerjoin like this without relationship: > select a.x, b.y from Table1 as a INNER JOIN Table 2 as b ON a.z=b.w > Note: a.z and b.w are not primary and foreign keys -- This message was sent by Atlassian JIRA (v6.2#6252)