jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandru Popescu ☀" <the.mindstorm.mailingl...@gmail.com>
Subject Re: Complex Queries
Date Fri, 21 Dec 2007 09:39:26 GMT
On Dec 20, 2007 10:31 PM, Dan Diephouse <dan.diephouse@mulesource.com> wrote:
> I'm struggling a little bit to understand how to do a more complex
> query. Let say I have a model like this:
>
> /blog
> /blog/name = "Dan's Blog"
> /blog/author = "Dan Diephouse"
> /blog/entry
> /blog/entry/title = "Jackrabbit"
> /blog/entry/content ....
>
> I want to do a query where I select the blog node where /entry/title =
> "Jackrabbit" OR /blog/author = "Dan Diephouse"
>
> In my own perverted SQL syntax: select /blog  where author = "Dan
> Diephouse" or entry/title = "Jackrabbit"
>
> I don't see how it's possible to create an SQL syntax where you test for
> properties both on the node you're selecting and on it's child though.
> Can anyone enlighten me?
>
> Thanks,
> - Dan
>
> --
> Dan Diephouse
> MuleSource
> http://mulesource.com | http://netzooid.com/blog
>
>

Hi Dan!

I don't think it will work in this format. I guess the only way to get
this working is by using a query based on the node type (in case both
/blog and /blog/entry share the same type or at least mixin) and then
your query (XPath query) will be something like:

//element(*, <common_type_or_mixin>)[@author='' OR @title='']

(this suggestions comes with no guarantees ;-), as I haven't tried it).

./alex
--
.w( the_mindstorm )p.

Mime
View raw message