[jira] [Commented] (JDO-730) Creating the innerjoin without relationship between objects
[ https://issues.apache.org/jira/browse/JDO-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14066520#comment-14066520 ] RaviRaja commented on JDO-730: -- Yes. Thanks > 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)
[jira] [Commented] (JDO-730) Creating the innerjoin without relationship between objects
[ https://issues.apache.org/jira/browse/JDO-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14066475#comment-14066475 ] Michael Bouschen commented on JDO-730: -- Does the answers satisfy your needs? If yes, I would close the JIRA, thanks. > 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)
[jira] [Commented] (JDO-730) Creating the innerjoin without relationship between objects
[ https://issues.apache.org/jira/browse/JDO-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14060519#comment-14060519 ] RaviRaja commented on JDO-730: -- Thank you. > 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)
[jira] [Commented] (JDO-730) Creating the innerjoin without relationship between objects
[ https://issues.apache.org/jira/browse/JDO-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14058996#comment-14058996 ] Craig L Russell commented on JDO-730: - Using a variable to identify the second table should result in the additional table in the FROM clause. The condition should then appear in the WHERE clause of the query. Putting the condition into the JOIN clause is simply SQL shorthand. The optimizer should not generate a different execution plan for the two queries. If this doesn't make sense, please post the SQL that you would like to see and its execution plan and then the generated SQL with its execution plan so we can understand your concern. > 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)
[jira] [Commented] (JDO-730) Creating the innerjoin without relationship between objects
[ https://issues.apache.org/jira/browse/JDO-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14058470#comment-14058470 ] RaviRaja commented on JDO-730: -- Thanq for you reply, The above query is making cross join. But we need an innerjoin between objects with ON clause. However this can be solved by .contains() clause but it implicitly innerjoins only primary and foreign keys. But we need innerjoin rather than primary and foreign key Query as follows: select this.x, b.y from com.xyz.Class1 where this.contains(b) variables com.xyz.Class2 b This query only innerjoins with ON clause condition this.pkey==b.foreignkey But we need the explicit innerjoins rather than implicit innerjoins > 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)
[jira] [Commented] (JDO-730) Creating the innerjoin without relationship between objects
[ 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)