cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <...@maniatis.org>
Subject Re: SelectQuery + Orderings
Date Sat, 28 Jan 2012 09:38:09 GMT
On 28/01/12 12:51 AM, Andrus Adamchik wrote:
>> My only quibble with order() is it sounds immediate.  Maybe orderBy()
>> instead?
>
> Fine with me.
>
>> For fetch limits, could have a limitTo() method?
>
> FetchLimit is a bit different - it a "property" in a Java beans sense. The ordering API
changes do not affect the "property" aspect of it. So what is the goal here, to provide chainable
API?

Personally I like it. I think I mentioned Ruby/Rails before, and their chainable query API
is very succinct and readable. Now Java is naturally more verbose than Ruby as a language,
but I like the sort of chainable api that looks something like this:

    List artists<Artist> = SelectQuery(Artist.class).where("name LIKE 'b%').and('age
> 23').join(Gallery.class).limit(10).order(Artist.name).perform();

We've had this conversation before, and I guess it really needs one of us to write up the
full class API for what this sort of approach would look like if it is ever going to get past
these conversations. I'd love if I had more time to sit down and think about this, but realistically
that isn't soon.

Regards

Ari
  

-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Mime
View raw message