jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulrich <For...@gombers.de>
Subject Re: JCR-JQOM: JOIN returns Message: WARN NodeIteratorImpl - Exception retrieving Node with Id: null
Date Mon, 17 Jun 2013 08:44:16 GMT
I tried the same example with JCR-SQL2. This fails for another reason - but may
help to understand what I try to do:

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

Here I get an Exception; there is probably a syntax error in the queryString.
(I'm not familiar with the syntax).

Exception in thread "main" javax.jcr.query.InvalidQueryException: Query:
select * from [nt:file] as parent inner join [nt:resource] as child on
ISCHILDNODE(child,parent)WHERE
ISDESCENDANTNODE([descendant],/content(*)/testit); expected: )

Ulrich


> Ulrich <Forums@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

Mime
View raw message