<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<section id="JCR.OrderByPathOrName">
  <title>Ordering by Path or Name</title>

  <warning>
    <para>Ordering by jcr:path or jcr:name does not supported.</para>
  </warning>

  <para>There is two ways to order results, when path may be used as
  criteria:</para>

  <itemizedlist>
    <listitem>
      <para>Order by property with value type NAME or PATH (jcr supports
      it)</para>
    </listitem>

    <listitem>
      <para>Order by jcr:path or jcr:name - sort by exact path or name of node
      (jcr do not supports it)</para>
    </listitem>
  </itemizedlist>

  <para>If no order specification is supplied in the query statement,
  implementations may support document order on the result nodes (see jsr-170
  / 6.6.4.2 Document Order). And it's sorted by order number.</para>

  <para>By default, (if query do not contains any ordering statements) result
  nodes is sorted by document order.</para>

  <programlisting>SELECT * FROM nt:unstructured WHERE jcr:path LIKE 'testRoot/%'</programlisting>
</section>
