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.
Activity
Benjamin Eberlei
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
This is mostly from Discussion in IRC had the following results: * Snippet should be SQL to allow for more flexibility * 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: {code} 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 {code} * The Table alias is set by replacing a magic %alias% string. This is ugly but the most simple solution. The next viable solution would mean implementing a parser for SQL, which is too complex. * 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. * In SqlWalker::walkOrderByClause - After the user defined ORDER BY Items, loop over the order collections and append the appropriate sql snippets, to the already generated ORDER BY stuff and replace the %alias% with the relevant table alias. |
This is mostly from 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: {code} 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 {code} * 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. |
Benjamin Eberlei
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Benjamin Eberlei
made changes -
| Workflow | jira [ 10894 ] | jira-feedback [ 14279 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback [ 14279 ] | jira-feedback2 [ 16143 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 16143 ] | jira-feedback3 [ 18396 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-338, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
This is now finally implemented, tests for default and CTI use-cases exist.