JCR SQL2-结果查询顺序与在JCR浏览器中一样 [英] JCR SQL2 - result query order as in JCR browser

查看:172
本文介绍了JCR SQL2-结果查询顺序与在JCR浏览器中一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用一个可以在其中操纵JCR节点的应用程序,通常您会重命名,删除,删除或移动它们.

I use an application where we can manipulate JCR nodes, typically you would rename, remove, delete, or else move them.

使用JCR API,我可以访问存储库中的节点,并以与JCR中相同的顺序返回一组节点.

Using the JCR API, I can access the nodes in my repository and return a set of nodes in the same order as they are in the JCR.

我希望能够使用JCR SQL2查询执行相同的操作.我还没有发现有关此&的任何信息现在开始相信这是不可能的.

I would like to be able to do the same using the JCR SQL2 queries. I have not found anything about this & now start to believe this is not possible.

例如,如果我有一个JCR树,例如:

For instance, if I have a JCR tree such as:

parentNode
|_childNode1
|_childNode2
|_childNode3
|_childNode4

使用JCR SQL2查询时,它将以与以下顺序不同的顺序返回它们:childNode1,childNode2,childNode3,childNode4

When querying using the JCR SQL2 it would return them in an order different from: childNode1, childNode2, childNode3, childNode4

我查看了其他文档: http://docs.jboss.org/jbossdna/0.7/manuals/reference/html/jcr-query-and-search.html#jcr-sql2-query-language http://www.day.com/specs/jcr/2.0/6_Query. html

I look in those docs among others: http://docs.jboss.org/jbossdna/0.7/manuals/reference/html/jcr-query-and-search.html#jcr-sql2-query-language http://www.day.com/specs/jcr/2.0/6_Query.html

预先感谢

编辑:如果可以选择使用Java进行搜索,则可能需要查看

EDIT: if using Java for your search is an option, you might want to look at Recursive search in JCR repo via java

虽然可能不是最有效的,所以请留意性能的提高.

Probably NOT the most efficient though, so mind the performance hit.

推荐答案

您是否尝试在

如果为true,并且查询中不包含"order by"子句,则结果节点将按文档顺序排列.为了获得更好的性能,当查询返回许多设置为"false"的节点时(在1.5中,现在默认为"false").

If true and the query does not contain an 'order by' clause, result nodes will be in document order. For better performance when queries return a lot of nodes set to 'false' (In 1.5 'false' is now the default).

只有在需要时才应将其设置为true,因为查询结果将完全用Java进行迭代以对其进行排序.

You should set it to true really only if you need it, because query results will be iterated fully in Java in order to sort them.

这篇关于JCR SQL2-结果查询顺序与在JCR浏览器中一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆