jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Node.getNodes and Node.hasNodes for a specific nodeType
Date Tue, 08 Jul 2008 15:27:53 GMT
On Tue, Jul 8, 2008 at 2:49 PM, Matthijs Wensveen <m.wensveen@func.nl> wrote:
> Is it possible to ask a Node whether it has child nodes of a specific
> nodeType? Currently I'm able to do this with an XPath query, but it would be
> a lot easier, and possibly faster, when I could ask this to the node
> directly.

No, this is not possible, but you can easily filter the nodes in the
iterator returned by Node.getNodes(). This would not be a performance
difference if it would be implemented directly in JCR.

> Also, is it possible to mark a child node definition that is also marked as
> 'multiple' with 'primary'? If that is the case, maybe I could use
> getPrimaryItem.

Node.getPrimaryItem() simple does a getProperty() or getNode() (if
property exists, it is preferred) with the exact name defined in the
primaryItem setting of the node type. So if you have same name
siblings, you can only get one of them (eg. "mychildnode" or


Alexander Klimetschek

View raw message