jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Retrieve all properties associated with node after query
Date Mon, 14 Sep 2009 10:37:30 GMT
On Fri, Sep 11, 2009 at 19:47, Michael Shoener
<mshoener@softwareapps.net> wrote:
> I have created a custom mixin which has a property called "hfs:description",
> but also allows for residual properties too.
>
> How can I query the repository and return all properties, including custom
> defined ones, associated with the returned record?
>
> Do I have to loop through all of the results and manually retrieve all of
> the properties for each node?

The QueryResult [1] returns either a NodeIterator (ie. it returns
nodes) or a RowIterator, which is slightly different in that is more
"focused" on returning columns = properties when specifying those in a
SQL query, but in the end a row is a node as well.

So to get the properties you want, you have to iterate over the nodes
and get them with the normal Node API.

[1] http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/query/QueryResult.html

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message