jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: SQL2 (via davex)
Date Wed, 10 Aug 2011 10:04:07 GMT
Hi,

On Wed, Aug 10, 2011 at 11:46 AM, Lukas Kahwe Smith <mls@pooteeweet.org> wrote:
> I explained the use case in my original post. What I need to do is to
> get the last X days within /issues sorted decending by date

I was rather interested in the reason why you need the list of last X
days, i.e. what value does some client of your application get from
this information? A more typical query for an issue tracker system
(which I assume you're building) would be to ask for the last X
issues.

Anyway, assuming the date nodes really are needed for more than just
organizing the underlying issue nodes, I'd recommend labeling them
with their own node types and adding relevant information like the
date as properties of those nodes. Parsing information from the path
(like in this case the date) can lead to unnecessarily complex code
like we're seeing here.

With such a node type, you should be able to get the last X days with
the following query and a limit of just X results:

    SELECT * FROM [my:day] WHERE ISDESCENDANTNODE('/issues') ORDER BY date DESC

BR,

Jukka Zitting

Mime
View raw message