Details
-
Type:
Sub-task
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-ALPHA4
-
Fix Version/s: 2.0-BETA1
-
Component/s: None
-
Security Level: All
-
Labels:None
Description
This is mostly from DDC-293:
Discussion in IRC had the following results:
- Snippet should be Simple DQL
- Snippet should always be appended to any existing Order By statements, thereby only affecting the emitation of the collection elemets and not any previously requested order
- If the DQL revereses the order previously this should be overwritten, very simple:
1. @orderBy("b.start_year ASC, b.end_year DESC")
2. SELECT a, b FROM a JOIN b ORDER BY b.startYear DESC
1+2 => ORDER BY b.start_year DESC, b.start_year ASC, b.end_year DESC
- In Parser::Join() - Detect ordered collections that are fetch joined and save this information in _queryComponents.
- In Parser::SelectStatement() - If there exists a query component that has to be ordered, make sure the OrderByClause is created and append the OrderByItems from _queryComponents.
- In SqlWalker::walkOrderByClause the Order By SQL is generated correctly then.
This is now finally implemented, tests for default and CTI use-cases exist.