Details
Description
The DQL reference at
http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html
defines that
"You may have observed that in a mixed result, the object always ends up on index 0 of a result row."
I find this too important to state it in such a parenthetic way.
The reordering is counterintuitive behaviour at its worst, and grossly in violation of the principle of least astonishment. I bet noone would even guess that this could be intended behaviour. I would not consider this a classic bug, as it is documented behaviour, but as a way of deliberately doing it wrong, making mixed results totally counterintuitive to use. From a usability standpoint, this is as bad as it gets.
I cannot think of any convincing reason why the ORM should decide on its own, and without any notice, to change the explicitly specified ordering from the select list, because it is absolutely confusing and IMO there is no advantage at all in doing so.
I explicitly told Doctrine 2 to put the entity element on position 3, so why should it end up at position 0 without further notice? If position 0 is a must (which I do not think it should be), then the user should not be able to specify entity elements at any other position than that. As long as other positions are permissible, I would rather have the element stay at the exact position declared, and not be shuffled around.
Issue Links
- relates to
-
DDC-1424
Make order in DQL SELECT clause matter for hydration
-
Activity
| Field | Original Value | New Value |
|---|---|---|
| Description |
The DQL reference at http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html defines that "You may have observed that in a mixed result, the object always ends up on index 0 of a result row." I find this too important to state it in such a parenthetic way. The reordering is counterintuitive behaviour at its worst, and grossly in violation of the principle of least astonishment. I bet noone would even guess that this could be intended behaviour. I would not consider this a classic bug, as it is documented behaviour, but as a way of deliberately doing it wrong, making mixed results totally counterintuitive to use. From a usability standpoint, this is as bad as it gets. I cannot think of any convincing reason why the ORM should decide on its own, and without any notice, to change the explicitly specified ordering from the select list, because it is absolutely confusing and IMO there is no advantage at all in doing so. I explicitly told Doctrine 2 to put the entity element on position 3, so why should it end up at position 0 without further notice? If position 0 is a must (which I do not think it should be), then the user should not be able to specify entity elements at any other position than that. As long as other positions are permissible, I would rather have the element stay at the exact position declared, and not be shuffled around. |
The DQL reference at http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html defines that "You may have observed that in a mixed result, the object always ends up on index 0 of a result row." I find this too important to state it in such a parenthetic way. The reordering is counterintuitive behaviour at its worst, and grossly in violation of the principle of least astonishment. I bet noone would even guess that this could be intended behaviour. I would not consider this a classic bug, as it is documented behaviour, but as a way of deliberately doing it wrong, making mixed results totally counterintuitive to use. From a usability standpoint, this is as bad as it gets. I cannot think of any convincing reason why the ORM should decide on its own, and without any notice, to change the explicitly specified ordering from the select list, because it is absolutely confusing and IMO there is no advantage at all in doing so. I explicitly told Doctrine 2 to put the entity element on position 3, so why should it end up at position 0 without further notice? If position 0 is a must (which I do not think it should be), then the user should not be able to specify entity elements at any other position than that. As long as other positions are permissible, I would rather have the element stay at the exact position declared, and not be shuffled around. |
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 2.0.3 [ 10117 ] | |
| Resolution | Fixed [ 1 ] |
| Fix Version/s | 2.0.4 [ 10130 ] | |
| Fix Version/s | 2.0.3 [ 10117 ] |
| Issue Type | Bug [ 1 ] | Improvement [ 4 ] |
| Resolution | Fixed [ 1 ] | |
| Status | Resolved [ 5 ] | Reopened [ 4 ] |
| Assignee | Benjamin Eberlei [ beberlei ] | Guilherme Blanco [ guilhermeblanco ] |
| Status | Reopened [ 4 ] | Resolved [ 5 ] |
| Resolution | Duplicate [ 3 ] |
| Workflow | jira [ 12526 ] | jira-feedback [ 14816 ] |
| Workflow | jira-feedback [ 14816 ] | jira-feedback2 [ 16680 ] |
| Workflow | jira-feedback2 [ 16680 ] | jira-feedback3 [ 18933 ] |