On 4/03/10 8:28 AM, Andrus Adamchik wrote:
Also here is a reason why I don't find ordering of relationships
particularly useful is that things like ordering are context dependent
("context" in a general sense)... The same mapping can be used by
different UI frontends with different ordering requirements.
Having a default ordering for ObjEntities defined in the model is what Rails
does. Any time you fetch that entity, be it directly through a Query or via a
relation, you get the results back with that ordering.
Personally I don't see the point. Ordering in the database is very useful if
you are paging the results. Or using a limit. But when following relations,
neither of those things applies, so you may as well just do it in memory once
you have the list returned.
Perhaps a simplified notation might be useful though:
artist.getPaintings(Comparator/Ordering)
Ari
--
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A