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 "Timo Westkämper (JIRA)" <ji...@apache.org> on 2009/06/18 11:23:07 UTC

[jira] Created: (JDO-633) List.get(int) support in JDOQL is missing

List.get(int) support in JDOQL is missing
-----------------------------------------

                 Key: JDO-633
                 URL: https://issues.apache.org/jira/browse/JDO-633
             Project: JDO
          Issue Type: New Feature
            Reporter: Timo Westkämper


It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.

Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Commented: (JDO-633) List.get(int) support in JDOQL is missing

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

Craig Russell commented on JDO-633:
-----------------------------------

Andy commented:

A List has an order (whether it is an "indexed" List, or 
an "ordered" List (using JPA-style ordering criteria)). The user puts items 
in the List and persists the List. The user then wants to grab element at 
index 2. Storing the order in the datastore, in some way, is essential to 
support (indexed) Lists, hence querying should be straightforward. Since JDO 
doesn't define an ordering constraint, it is reasonable to assume that in JDO 
a List is an "indexed" List, hence retains the users ordering.

As far as testing goes, surely all you need to do is persist an object with a 
List with some elements in some order, and then do a query, assuming the same 
order as they had at the moment of persistence. Where does DB-specific SQL 
come into this ? surely that is the problem for the implementation.



> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Commented: (JDO-633) List.get(int) support in JDOQL is missing

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

Michael Bouschen commented on JDO-633:
--------------------------------------

Hi Andy,

I think the patch is OK to be checked in. 
How about changing the datanucleus dependencies to the latest SNAPSHOT version such that the new TCK test succeeds?

If you could check in the patch and change the dependencies, I would take a look at cleaning up the SupportedXXXMethods TCK classes, in order to make use of method getPersistentCompanyModelInstance.

Michael



> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: list_get_method.patch
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Commented: (JDO-633) List.get(int) support in JDOQL is missing

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

Michael Bouschen commented on JDO-633:
--------------------------------------

I checked in the code refactoring (see revision 1026673)

Proposed spec changes:
Add an entry in table 5  Query Methods in chapter 14.6.2 Filter specification, section Methods on page 170 of the JDO 3.0 spec:
get(int) applies to List types


> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>            Assignee: Michael Bouschen
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: list_get_method.patch
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Commented: (JDO-633) List.get(int) support in JDOQL is missing

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

Craig Russell commented on JDO-633:
-----------------------------------

The specification update is trivial. The RI sounds straightforward. Interim to being part of the required query methods, perhaps Timo and Andy can collaborate on seeing how to make this work?




> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Updated: (JDO-633) List.get(int) support in JDOQL is missing

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

Michael Bouschen updated JDO-633:
---------------------------------

          Component/s: specification
    Affects Version/s: JDO 2 maintenance release 2

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: query2, specification
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Updated: (JDO-633) List.get(int) support in JDOQL is missing

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

Timo Westkämper updated JDO-633:
--------------------------------

    Component/s: query2

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: query2
>            Reporter: Timo Westkämper
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Updated: (JDO-633) List.get(int) support in JDOQL is missing

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

Andy Jefferson updated JDO-633:
-------------------------------

    Attachment: list_get_method.patch

Attached patch adds MeetingRoom class (and some seemingly necessary interfaces and company factory builder methods). Also adds 2 tests for List.get() - one in the filter and one in the result. DataNucleus SVN "trunk" and "branches/2.1" both pass on these tests (though 2.1.0 fails on the result case). 
Not got the number of the assertion to include in the test java file.

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: list_get_method.patch
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Updated: (JDO-633) List.get(int) support in JDOQL is missing

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

Andy Jefferson updated JDO-633:
-------------------------------

    Fix Version/s: JDO 2 maintenance release 4

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>             Fix For: JDO 2 maintenance release 4
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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

       

[jira] Commented: (JDO-633) List.get(int) support in JDOQL is missing

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

Michael Bouschen commented on JDO-633:
--------------------------------------

Good job Andy!

I figured out there is a relationship field of type List in package org.apache.jdo.tck.pc.companyListWithoutJoin: the employees field of class Department.
However, I like your solution better adding a new class MeetingRoom and a list relationship to class Department.

A few comments:

- I tested your patch with dataNuclues 2.2.0-m1 and the result test runs into a NPE. Is this the failure you mentioned?
    [java] 1) testGetInResult(org.apache.jdo.tck.query.jdoql.methods.SupportedListMethods)java.lang.NullPointerException
    [java] at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:306)
    [java] at org.datanucleus.store.query.Query.executeQuery(Query.java:1642)

- In the new test class SupportedListMethods you could make use of method getPersistentCompanyModelInstance to calculate the parameter value.
  So the statement
        Object[] parameters = new Object[]{1,
                getParameter(MeetingRoom.class, "roomid == 2", true)};
  can be replaced by
        getPM().currentTransaction().begin();
        Object[] parameters = new Object[]{1, getPersistentCompanyModelInstance("room2")};
        getPM().currentTransaction().commit();
  Then you do not need the local method getParameter anymore.

- There are some ToDos in the code. Do they need o be resolved before this can be checked in?

Regards Michael

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: list_get_method.patch
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Commented: (JDO-633) List.get(int) support in JDOQL is missing

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

Andy Jefferson commented on JDO-633:
------------------------------------

SVN trunk now has these new tests, and the updates to DataNucleus dependencies (available from DN "maven-nightly" Maven1 repo).

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: list_get_method.patch
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Commented: (JDO-633) List.get(int) support in JDOQL is missing

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

Andy Jefferson commented on JDO-633:
------------------------------------

DataNucleus query language="JDOQL2" (a replacement for the JDOQL implementation that we've used since day 1, for RDBMS datastores) now has support for List.get(int). Set persistence property "datanucleus.query.JDOQL.implementation" to be "JDOQL2" and it will use this implementation. 

In-memory evaluation of JDOQL also has support for List.get(int).

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Updated: (JDO-633) List.get(int) support in JDOQL is missing

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

Michael Bouschen updated JDO-633:
---------------------------------

    Component/s:     (was: query2)
                 tck2

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Commented: (JDO-633) List.get(int) support in JDOQL is missing

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

Andy Jefferson commented on JDO-633:
------------------------------------

Thx Michael.
- I added TODOs since the job of "just adding a new model class" impacts on other "models" and I don't need the MeetingRoom class in those models, so far simpler just to put TODOs. We don't need the TODOs completing for these tests, and all tests pass fine as is, so ok for check-in (IMHO)
- The test failure you see is the same as the one in 2.1.0. SVN works fine on both branches
- Didn't know about that method, so yes it could go in. I simply copied the code from SupportedCollectionMethods, so that will need the same change (and maybe SupportedMapMethods too)

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: list_get_method.patch
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Assigned: (JDO-633) List.get(int) support in JDOQL is missing

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

Michael Bouschen reassigned JDO-633:
------------------------------------

    Assignee: Michael Bouschen

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>            Assignee: Michael Bouschen
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: list_get_method.patch
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Assigned: (JDO-633) List.get(int) support in JDOQL is missing

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

Michael Bouschen reassigned JDO-633:
------------------------------------

    Assignee: Craig L Russell  (was: Michael Bouschen)

Assigning the JIRA to Craig for the spec update.

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>            Assignee: Craig L Russell
>             Fix For: JDO 3 maintenance release 1
>
>         Attachments: list_get_method.patch
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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


[jira] Commented: (JDO-633) List.get(int) support in JDOQL is missing

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

Andy Jefferson commented on JDO-633:
------------------------------------

Considered adding new test(s) for List.get. Unfortunately "company" has no "List" field present! Perhaps Department ought to have a List of "MeetingRoom" ? Any alternative suggestion from someone more intimate with this model ?

> List.get(int) support in JDOQL is missing
> -----------------------------------------
>
>                 Key: JDO-633
>                 URL: https://issues.apache.org/jira/browse/JDO-633
>             Project: JDO
>          Issue Type: New Feature
>          Components: specification, tck
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Timo Westkämper
>             Fix For: JDO 3 maintenance release 1
>
>
> It would be nice to get List.get(int) into JDOQL, in other words access of indexed list elements.
> Querydsl has support for that and for consistency it would be nice if JDOQL supported it as well.

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