|
|
|
[
Permlink
| « Hide
]
Tiago Silveira - [20/Nov/06 12:09 Central European Time ]
Sorting in MUM should be done mainly with the Marbles filter.
Still not complete. I only added a sorter for the attributes. We need to add sorting by SystemId and by Parent too.
Maybe some constants? Filter.sortAsc(Filter.SYSTEM_ID); or Filter.sortBySystemIdAsc(); There's also the possibility to reserve those words: Filter.sortAsc("systemId"); // it's never an attribute. This might even be better, but would cause a compatibility break, so we cannot release it for 0.9.5. I have also added two extra cases:
1) systemId and id are reserved 2) if a key contains a dot (e.g. "marriedTo.name"), it will be interpreted as a reference to another object. You can go as deep as you want, if the object doesn't have the correct key, the value is interpreted as being NULL. 2.b) if a key or fragment starts with "parent.", it will be interpreted not as a reference to another PObject, but as a reference to the parent PObject. Thus, the following sorting is valid: Filter.sortAsc("parent.name") .sortDesc("marriedTo.parent.id"); It will be interpreted as sort ascending on the parent's name and descending on the id of the parent of the object reached by the reference "marriedTo". |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||