You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Michelle Caisse (JIRA)" <ji...@apache.org> on 2006/12/09 00:18:20 UTC

[jira] Created: (JDO-446) Add subqueries APIs

Add subqueries APIs
-------------------

                 Key: JDO-446
                 URL: http://issues.apache.org/jira/browse/JDO-446
             Project: JDO
          Issue Type: New Feature
          Components: api2, api2-legacy
    Affects Versions: JDO 2 final
            Reporter: Michelle Caisse


In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554893 ] 

Craig Russell commented on JDO-446:
-----------------------------------

Looks good. Just a few comments:

1. +    void runTestSuqueriesXX(PersistenceManager pm) {
probably should be 
+    void runTestSubqueriesXX(PersistenceManager pm) {

2. Just a thought. Should we run queries against memory model instances as well?

3. The new/updated classes apply to both tck2 and tck2-legacy, right?


> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch, subquery-tck.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-446:
---------------------------------

    Attachment:     (was: subquery-api.patch)

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-446?page=all ]

Craig Russell updated JDO-446:
------------------------------

    Fix Version/s: JDO 2 maintenance release 1

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: http://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>         Assigned To: Craig Russell
>             Fix For: JDO 2 maintenance release 1
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-446:
---------------------------------

    Attachment: subquery-api.patch

I agree there is no need to duplicate the javadoc, especially as we do  no duplicate the javadoc description in other places of the JDO API (e.g. overloaded PersistenceManager methods).

I updated the patch, you find attached for review. Now the String... version of the method has the full javadoc and all the other addSubquery methods refer to this. 


> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-446:
---------------------------------

    Attachment: subquery-api.patch

Added an updated version of the patch (subquery-api.patch).

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt, subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-446:
---------------------------------

    Attachment:     (was: subquery-tck.patch)

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-446:
---------------------------------

    Attachment: subquery-tck.patch

Attached you find the first version of the tck test cases (subquery-tck.patch).
I added a new package org.apache.jdo.tck.query.jdoql.subqueries and a new test class per subquery assertion.  The test  data file companyForSubqueriesTests.xml defines the test data for the subquery tests. 

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch, subquery-tck.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-446:
------------------------------

    Attachment:     (was: Query-patch.txt)

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell reopened JDO-446:
-------------------------------

      Assignee: Michelle Caisse  (was: Craig Russell)

We now need tck test cases for this feature.

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michelle Caisse
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555738#action_12555738 ] 

Craig Russell commented on JDO-446:
-----------------------------------

Looks good.

Craig

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch, subquery-tck.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-446:
---------------------------------

    Attachment: subquery-api.patch

Please review the patch subquery-api.patch. It adds the missing addSubquery methods to the JDO Query interface. 

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt, subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell resolved JDO-446.
-------------------------------

    Resolution: Fixed

svn commit -m "JDO-446 Add addSubquery api to Query" api20/src/java/javax/jdo/Query.java
Sending        api20/src/java/javax/jdo/Query.java
Transmitting file data .
Committed revision 509811.


> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>         Assigned To: Craig Russell
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539191 ] 

Michael Bouschen commented on JDO-446:
--------------------------------------

Hi Craig,

1. Good catch. I will change the @param javadoc as proposed before I check in the patch.

2. I think there are usecases where the subquery uses the extent as the candidate collection. However, I'm not sure whether it is worth adding a new method. Moreover, I think we would need to add 4 new methods: the one you proposed plus 3 more handling subquery parameters.

Regards Michael


> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538901 ] 

Craig Russell commented on JDO-446:
-----------------------------------

Here's what the spec currently says about Map method:
The Map version of the method treats the key of each map entry as the name of the parameter in the subquery, with or without the leading ":", and the value as the name of the expression in the outer query. If the trimmed expression is the empty String for either the parameter or the value of the String[], or for any map key or value, that expression is ignored.

And for the Object... method:
The String[] version of the method binds the named expressions in turn to parameters in the order in which they are declared in the subquery, or in the order they are found in the filter if not explicitly declared in the subquery. 

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt, subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-446:
---------------------------------

    Attachment: subquery-tck.patch

Attached you find an updated version of the patch subquery-tck.patch:
- I fixed the typo in the method name (should be runTestSubqueriesXX)
- I added tests against the a memory collection containing all employees to three of the new test classes.

Yes, the changes apply to both tck2 and tck2-legacy.

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch, subquery-tck.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12558290#action_12558290 ] 

Michael Bouschen commented on JDO-446:
--------------------------------------

Good catch! I fixed the name of the field (see revision 611476). 

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch, subquery-tck.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-446:
---------------------------------

    Attachment:     (was: subquery-api.patch)

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt, subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-446) Add subqueries APIs

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12558218#action_12558218 ] 

Andy Jefferson commented on JDO-446:
------------------------------------

Minor point : the queries seem to assume a field "firstName" in Person yet it is "firstname"

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch, subquery-tck.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539163 ] 

Craig Russell commented on JDO-446:
-----------------------------------

Two questions. 

1. The javadoc for param parameter[s] say
+     * @param parameters the actual values of the subquery parameters

But it isn't the actual values, it's the name of the expression in the outer query to bind the parameter. The description is ok, but the @param should probably say 
* @param parameter the expression from the outer query to bind the parameter in the subquery

2. Should we consider one more method, with two arguments, that has the candidate collection be the extent of the candidate class of the subquery? This would avoid the need for passing null as the candidateCollectionExpression. Might be too much of a corner case.


> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JDO-446) Add subqueries APIs

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-446?page=all ]

Michelle Caisse reassigned JDO-446:
-----------------------------------

    Assignee: Craig Russell

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: http://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>         Assigned To: Craig Russell
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538242 ] 

Craig Russell commented on JDO-446:
-----------------------------------

Hi Michael,

As I was reading the patch, I thought that it might be better if we eliminated most of the javadoc that is duplicated in the four addSubquery methods. This is because some of the wording used in the original patch has been changed in the specification to make it clearer. Specifically, the specification now says 
This method adds a subquery to this Query. A subquery is composed as a Query and subsequently attached to a different Query (the outer Query) by calling this method. The String parameters are trimmed of white space. 
The Query parameter instance is unmodified as a result of the addSubquery or subsequent execution of the outer Query. Only some of the parameter query parts are copied for use as the subquery. The parts copied include the candidate class, filter, parameter declarations, variable declarations, imports, ordering specification, uniqueness, result specification, and grouping specification. The association with a PersistenceManager, the candidate collection or extent, result class, and range limits are not used. 
The variableDeclaration parameter is the name of the variable containing the results of the subquery execution. If the same value of variableDeclaration is used to add multpile subqueries, the subquery replaces the previous subquery for the same named variable. If the subquery parameter is null, the variable is unset, effectively making the variable named in the variableDeclaration unbound. If the trimmed value is the empty String, or the parameter is null, then JDOUserException is thrown.
The candidateCollectionExpression is the expression from the outer query that represent the candidates over which the subquery is evaluated. If the trimmed value is the empty String, or the parameter is null, then the candidate collection is the extent of the candidate class.
When comments on the spec wording are all resolved, we should put them back into the javadoc. So I'm thinking that maybe we should avoid copying and pasting into four different methods.

What I don't understand well is the impact on javadoc for code completion. If we have the full javadoc only on the first method, and the paragraph on the parameter handling is mostly in the single string version, do we hurt the usability for users depending on javadoc for code completion? I'm pretty sure that javadoc for regular users will not suffer if there is a @see reference that points to the full description in the other method.

Any comments from code completion fans?

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt, subquery-api.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell reassigned JDO-446:
---------------------------------

    Assignee: Michael Bouschen  (was: Michelle Caisse)

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-446) Add subqueries APIs

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-446?page=all ]

Craig Russell updated JDO-446:
------------------------------

    Attachment: Query-patch.txt

Please review this patch.

This patch updates the Query interface by adding the method to support subqueries    
void addSubquery
           (Query sub, String variableDeclaration, String candidateCollectionExpression);


> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: http://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>         Assigned To: Craig Russell
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: Query-patch.txt
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (JDO-446) Add subqueries APIs

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen resolved JDO-446.
----------------------------------

    Resolution: Fixed

Checked in  the patch (see revision 609405).

The test cases currently fail because JPOX does not yet supports subqueries (see JDO-568).

> Add subqueries APIs
> -------------------
>
>                 Key: JDO-446
>                 URL: https://issues.apache.org/jira/browse/JDO-446
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2, api2-legacy
>    Affects Versions: JDO 2 final
>            Reporter: Michelle Caisse
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: subquery-api.patch, subquery-tck.patch
>
>
> In 14, add subqueries to permit e.g. select from Employee where this.salary > (select avg(salary) from Employee)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.