db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-637) JDOQL : Enhance the JDOQL with JOIN and ALIAS features
Date Tue, 28 Jul 2009 16:39:14 GMT

    [ 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.


Mime
View raw message