Jackrabbit Sql2-Query -> DescendantNodeJoinCondition
idb:photo
idb:uploadName jcr:primaryType="idbt:metaData" idb:value="4.jpg"
idb:size jcr:primaryType="idbt:metaData" idb:value="276757"
idb:title jcr:primaryType="idbt:metaData" idb:value="Title: 4.jpg"
idb:photo>
first of all i cant see my code example! -> clicked on {} and filed in my code!
i would like to get the information of a photo-node where for example the title is
Title: 4.jpg开发者_开发知识库
i have the following query:
Query query = queryManager.createQuery("select * from [idbt:photo] as p inner join [idbt:metaData] as c on isdescendantnode(p, c) where c.[idb:value] = 'Title: 4.jpg'", Query.JCR_SQL2);
my resultset is empty. it should be filled with my matched node!
what is wrong?
Greetings
I don't understand how the nodes are stored. Is it metadata-node/photo-node OR photo-node/metadata-node?
In the Query you have isdescendantnode(descendent, parent), don't you? Is it a child node? have you tried ischildnode?. Take a look at http://www.h2database.com/jcr/grammar.html#join
What version of JackRabbit are you using? How do you know that the result is empty? If for some reason you are using query.execute().getRows.getSize() to try to get the total number of results first, look at this https://issues.apache.org/jira/browse/JCR-2765
精彩评论