History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: TM-239
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Tiago Silveira
Reporter: Tiago Silveira
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Tiny Marbles

Filter.orderBy() API for sorting results

Created: 20/Nov/06 12:08 Central European Time   Updated: 06/Mar/07 17:26 Central European Time
Return to search
Issue 10 of 12 issue(s)
Component/s: Filters and Queries
Affects Version/s: None
Fix Version/s: 0.9.5

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Cause
This issue causes:
TM-282 Finish refactoring of the CriteriaQue... Major Closed
 
Precedence
This issue must be done before:
MUM-11 Sorting in the list Major Resolved
CMS-67 List all articles: sorting result Major Resolved
CMS-68 List all versions: sorting result Major Resolved
 
Related
This issue relates to:
TM-283 Fail when PType.put() is called using... Critical Resolved
This issue is related with:
TM-306 Coverage tests for sorter elements Major Open


 Description  « Hide
We need to be able to sort results by attribute value. I think an API like this could work:

List<PObject> users = repository.createFilter("User")
   .like("name", "a%")
   .orderBy("name")
   .list();

Maybe a better API would be sortAsc and sortDesc. The following example would sort first by release date, newest first, then by title, alphabetically:

List<PObject> objects = repository.createFilter("Songs")
  .in("tags", "rock")
  .sortDesc("releaseDate")
  .sortAsc("title")
  .list();

Since we are using the Criteria API from Hibernate under the hood, we can transfer the same semantics.

 All   Comments   Work Log   Change History   Version Control   Time Spent      Sort Order:
Change by Tiago Silveira [20/Nov/06 12:09 Central European Time]
Field Original Value New Value
Link This issue must be done before TM-225 [ TM-225 ]

Change by Markus Reichel [11/Jan/07 10:51 Central European Time]
Link This issue must be done before CMS-67 [ CMS-67 ]

Change by Markus Reichel [11/Jan/07 10:52 Central European Time]
Link This issue must be done before CMS-68 [ CMS-68 ]

Change by Tiago Silveira [05/Feb/07 17:41 Central European Time]
Fix Version/s 0.9.5 [ 10411 ]
Fix Version/s 1.0-rc1 [ 10195 ]

Change by Tiago Silveira [06/Feb/07 16:48 Central European Time]
Assignee Tiago Silveira [ tiago ]

Change by Tiago Silveira [06/Feb/07 16:48 Central European Time]
Status Open [ 1 ] In Progress [ 3 ]

Change by Tiago Silveira [08/Feb/07 18:19 Central European Time]
Link This issue causes TM-282 [ TM-282 ]

Change by Tiago Silveira [09/Feb/07 19:40 Central European Time]
Link This issue relates to TM-283 [ TM-283 ]

Change by Tiago Silveira [09/Feb/07 19:48 Central European Time]
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]

Change by Tiago Silveira [14/Feb/07 13:12 Central European Time]
Status Resolved [ 5 ] Closed [ 6 ]

Change by Tiago Silveira [06/Mar/07 17:26 Central European Time]
Link This issue is related with TM-306 [ TM-306 ]