You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Michael Shoener <ms...@softwareapps.net> on 2009/09/11 19:47:37 UTC

Retrieve all properties associated with node after query

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?

Any help would be appreciated. 


Best Regards,

Michael Shoener
Support Staff
Software Application Services, Inc.



Re: Retrieve all properties associated with node after query

Posted by Alexander Klimetschek <ak...@day.com>.
On Fri, Sep 11, 2009 at 19:47, Michael Shoener
<ms...@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