我正在尝试列出、排序和分页父节点下的所有文件夹和文件。这是我只选择文件夹的查询,它给了我预期的结果:
SELECT childFolder.[jcr:name], childFolder.[jcr:uuid] FROM [nt:base] AS parent LEFT OUTER JOIN [nt:folder] AS childFolder ON ISCHILDNODE(childFolder, parent) WHERE parent.[jcr:uuid] = 'a54ca11b-99f8-42cf-8348-8c0f3bc4f008' ORDER BY parent.[jcr:primaryType] DESC
然后我为文件添加另一个连接,但它不返回任何结果:
LEFT OUTER JOIN [nt:file] AS childFile ON ISCHILDNODE(childFile, parent)
最终查询:
SELECT childFolder.[jcr:uuid] FROM [nt:base] AS parent LEFT OUTER JOIN [nt:folder] AS childFolder ON ISCHILDNODE(childFolder, parent) WHERE parent.[jcr:uuid] = 'a54ca11b-99f8-42cf-8348-8c0f3bc4f008' ORDER BY parent.[jcr:primaryType] DESC
1.有没有什么方法可以通过一次查询来获取文件夹和文件?2.在第一个查询中,我尝试获取 [jcr:name] 但它给了我 null。如何获取节点的名称?