That is not the same, since you don't only have the AND operator at hand.

def books = Book.findAllByPublisheddateBetween(lastyear, today)

with lastyear and today being Date instances is also possible and a lot
more.

Sure it is possible to construct queries from arbitrary length method calls.
But in the above example there would be much to do in analyzing and it
doesn't help readybility either.

But of course, something like this in Java is probably out of the way.

Maybe something along the lines of

GenericDao bookDao = new GenericDao(Book.class).

List<Book> books = dao.findAllBy("publishedDate").between(Date.class,
lastYear, today);

would be possible.

Regards,
Otho

Reply via email to