Now I could create a SQL2 statement which delivers me the same result:

   "Select * from [nt:file] as parent " +
   "inner join [nt:resource] as child on ISCHILDNODE(child,parent) " +
   "WHERE ISDESCENDANTNODE(parent,[/content/testit])";

Do I have a logic problem here? I'm search the whole subtree of
"/content/testit" fo all nodes of type "nt:file" which have a child of type
"nt:resource".
The query should return me 4 nodes but instead it gives me four times the
message:
    "WARN  NodeIteratorImpl - Exception retrieving Node with Id: null"

Ulrich




> .. snip ..

>
> > Ulrich <for...@gombers.de> hat am 17. Juni 2013 um 10:01 geschrieben:
> >
> >
> > Still fighting with JCR-JQOM:
> > I need to retrieve "jcr:lastModified" from jcr:contend-childnode of every
> > nt:file-Node. My approach is:
> >
> > Selector ntFileSelector = qomf.selector("nt:file", "Parent");
> > Selector jcrContentSelector = qomf.selector("nt:resource", "Child");
> > Join join = qomf.join(ntFileSelector, jcrContentSelector,
> > QueryObjectModelFactory.JCR_JOIN_TYPE_INNER,
> >      qomf.childNodeJoinCondition(jcrContentSelector.getSelectorName(),
> > ntFileSelector.getSelectorName()));
> > Constraint getSubtree =
> > qomf.descendantNode(ntFileSelector.getSelectorName(),
> > subtree);
> > QueryObjectModel qom = qomf.createQuery(join, getSubtree, null, null);
> > QueryResult queryResult = qom.execute();
> > nodeIterator = queryResult.getNodes();
> >
> > From this I get four times the message:
> >    WARN  NodeIteratorImpl - Exception retrieving Node with Id: null
> > This means I get this message for every node which I expected to be selected
> > within the subtree.
> >
> > If I run the query without the "JOIN":
> > QueryObjectModel qom = qomf.createQuery(ntFileSelector, getSubtree, null,
> > null);
> > it is fine.
> >
> > brdgs,
> > Ulrich

Reply via email to