cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: SelectQuery + Orderings
Date Fri, 27 Jan 2012 07:11:53 GMT
IMO all of the suggestions are good. Summarizing:

1. SelectQuery(Class<?>, Expression) becomes an equivalent SelectQuery(Class<?>,
Expression, Ordering...)
2. (new) SelectQuery(Class<?>, Expression, List<Ordering>)
3. (new) SelectQuery order(String, SortOrder)
4. (new) SelectQuery order(Ordering... ordering)
5. (new) SelectQuery order(List<Ordering> orderings)

6. (deprecated) void addOrdering / addOrderings

On Jan 27, 2012, at 4:02 AM, Aristedes Maniatis wrote:

> On 27/01/12 4:15 AM, Michael Gentry wrote:
>> Any thoughts on updating SelectQuery.java to handle Orderings as:
>> 
>> SelectQuery(Class, Expression, Ordering) or
>> SelectQuery(Class, Expression, List<Ordering>) or
>> SelectQuery(Class, Expression, Ordering...) or
>> public SelectQuery addOrdering(Ordering ordering) and
>> public SelectQuery addOrderings(List<Ordering>  orderings) ...
>> 
>> I'm personally thinking the last, so it is chainable.
> 
> Purely from a naming point of view, both of these:
> 
>  public SelectQuery order(Ordering ordering)
>  public SelectQuery order(List<Ordering> orderings)
> 
> This is then chainable, and will read very nicely, particularly when combined with similar
functions for "limit", "join/prefetch", etc.
> 
> 
> 
> Ari
> 
> 
> -- 
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
> 


Mime
View raw message