[ https://issues.apache.org/jira/browse/JDO-721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Bouschen updated JDO-721: --------------------------------- Attachment: JDO-721.patch Attached you find a patch JDO-721.patch which adds two new query test cases and adapts the expected output of some other query tests, because of the new MedicalInsurance instance having a null field. I propose the following spec changes: - Chapter 14.3 Architecture: Query on page page 166: ordering specification. The ordering specification includes a list of expressions with the ascending/descending indicator and an optional null position specification. - Chapter 14.4 Namespaces in queries on page 167: Add the following to the list of JDOQL keywords: nulls, NULLS, first, FIRST, last, LAST - Chapter 14.6.6 Ordering statement on page 186: followed by one of the following words: “ascending”, “descending”,“asc”, or “desc”, followed by an optional null position specification. The Paragraph "The ordering of instances ... contain non-null values." is replaced by "The optional null position specification consists of either nulls first or nulls last. If nulls first is specified, instances containing null-valued fields are orderd before instances whose fields contain non-null values. If nulls last is specified, instances containing null-valued fields are orderd after instances whose fields contain non-null values. Without a null position the ordering of null values is not specified. - Chapter B.8 Ordering Specification on page 375: OrderingSpec: Expression Ascending NullPositionopt <- opt subscripted Expression Descending NullPositionopt <- opt subscripted NullPosition: nulls first <- bold nulls last <- bold - Chapter B.14 Keywords on page 379: Add the following keywords: nulls, NULLS, first, FIRST, last, LAST > Specifying NULL elements positioning in ordered columns > ------------------------------------------------------- > > Key: JDO-721 > URL: https://issues.apache.org/jira/browse/JDO-721 > Project: JDO > Issue Type: Improvement > Components: specification > Affects Versions: JDO 3 update 1 (3.0.1) > Reporter: Muhammad Gelbana > Assignee: Michael Bouschen > Priority: Minor > Labels: jdoql > Fix For: JDO 3.1 > > Attachments: JDO-721.patch > > > 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. -- This message was sent by Atlassian JIRA (v6.3.4#6332)