OpenJPA
  1. OpenJPA
  2. OPENJPA-1440

Allow COUNT(*) instead of COUNT(t0.id) for simple queries as an option

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.3, 1.3.0, 2.0.0-beta
    • Component/s: None
    • Labels:
      None

      Description

      SQL generated for "select p for PObject p" is SELECT COUNT(t0.id) FROM POBJECT t0". This is valid and according to JPQL spec which does not accept COUNT.

      However, JDBC Drivers for legacy databases may not always support COUNT(columnName) as reported in [1].

      OpenJPA should support such cases with a boolean option DBDictionary.useWildCardForCount.

      [1] http://n2.nabble.com/COUNT-t-to-COUNT-tc4176827.html#a4176827

      1. OPENJPA-1440-1.2.x.patch.txt
        6 kB
        Heath Thomann
      2. OPENJPA-1440-1.3.x.patch.txt
        6 kB
        Heath Thomann

        Activity

        Pinaki Poddar created issue -
        Hide
        Xiaoqin Feng added a comment -

        I am on vacation from 12/20/2009  to 12/26/2009.

        If you have any question on deployment and JEE bugs, please contact Saurabh Arora or my manager Maruthi Nuthikattu.

        For emergency, contact me at 925-209-5517.

        Show
        Xiaoqin Feng added a comment - I am on vacation from 12/20/2009  to 12/26/2009. If you have any question on deployment and JEE bugs, please contact Saurabh Arora or my manager Maruthi Nuthikattu. For emergency, contact me at 925-209-5517.
        Pinaki Poddar made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 2.0.0-M4 [ 12314149 ]
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Heath Thomann made changes -
        Attachment OPENJPA-1440-1.2.x.patch.txt [ 12442867 ]
        Hide
        Pinaki Poddar added a comment -

        Please correct the header on the TestCase attached with the patch.

        Show
        Pinaki Poddar added a comment - Please correct the header on the TestCase attached with the patch.
        Hide
        Heath Thomann added a comment -

        Added OPENJPA-1440-1.23.x.patch.txt for 1.2.x code and the OPENJPA-1440-1.3.x.patch.txt for 1.3.x code, as their names imply.

        Show
        Heath Thomann added a comment - Added OPENJPA-1440 -1.23.x.patch.txt for 1.2.x code and the OPENJPA-1440 -1.3.x.patch.txt for 1.3.x code, as their names imply.
        Heath Thomann made changes -
        Attachment OPENJPA-1440-1.3.x.patch.txt [ 12442885 ]
        Heath Thomann made changes -
        Attachment OPENJPA-1440-1.2.x.patch.txt [ 12442867 ]
        Heath Thomann made changes -
        Attachment OPENJPA-1440-1.3.x.patch.txt [ 12442885 ]
        Hide
        Heath Thomann added a comment -

        Updated header per Pinaki.

        Show
        Heath Thomann added a comment - Updated header per Pinaki.
        Heath Thomann made changes -
        Attachment OPENJPA-1440-1.2.x.patch.txt [ 12442887 ]
        Attachment OPENJPA-1440-1.3.x.patch.txt [ 12442888 ]
        Michael Dick made changes -
        Fix Version/s 1.2.3 [ 12314517 ]
        Fix Version/s 1.3.0 [ 12313326 ]

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            Pinaki Poddar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development