Uploaded image for project: 'JDO'
  1. JDO
  2. JDO-721

Specifying NULL elements positioning in ordered columns

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • JDO 3 update 1 (3.0.1)
    • JDO 3.1
    • specification

    Description

      I don't know about other RDBMS but in MySQL ordering, it's possible to specify whether NULL column fields are placed in the beginning or at the end of the ordering, i.e.:

      ORDER BY `values_column` IS NULL DESC
      [values_column]
      NULL
      NULL
      value1
      value2
      value3

      or the other way around (ORDER BY `values_column` IS NULL ASC):
      [values_column]
      value1
      value2
      value3
      NULL
      NULL

      I checked JDO 3 specification and found that JDOQL's ordering specification doesn't support specifying NULL values handling:
      ------------------------------------------------------------------------------
      26.7 Ordering Specification
      This section describes the syntax of the setOrdering argument.
      OrderingClause:
      OrderingSpecs ,opt
      OrderingSpecs:
      OrderingSpec
      OrderingSpecs , OrderingSpec
      OrderingSpec:
      Expression Ascending
      Expression Descending
      Ascending: one of
      asc ascending
      Descending: one of
      desc descending
      Please note, as a usability feature OrderingClause supports an optional trailing comma.
      ------------------------------------------------------------------------------

      Thank you for your time and efforts.

      Attachments

        1. JDO-721.patch
          11 kB
          Michael Bouschen

        Activity

          People

            mbo Michael Bouschen
            mgelbana Mohamed Mohsen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: