Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
ordering
Programmer's Guide > OpenAccess ORM Classic (Old API) > Programming With OpenAccess > Metadata Extension Reference > ordering

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

Orders a collection or array by specifying an OQL ordering expression (refer to Telerik OpenAccess ORM OQL Reference for more information). This expression is used to generate an order by for the SQL query that retrieves the elements. It implicitly sets ordered to false (see the Ordered extension). You can specify whether the query uses ascending or descending order by using the keywords ASC or DESC respectively. If you do not specify the order, the default value is ascending.

If the element-type of the collection is not one of your persistent classes (e.g. System.String) then use the this keyword to refer to the value. The only possible expressions in this case are this ascending and this descending.

Ordering only applies to the initial contents of the list populated from the SQL query. No attempt is made to keep the list in order as changes are made during normal execution.

Copy Code
<field name="studentList">
    <collection element-type="Student">
        <extension key="ordering" value="addr.city ascending, addr.street ascending" />
    </collection>
</field>

<field name="emailList">
    <collection element-type="System.String">
        <extension key="ordering" value="this descending" />
    </collection>
</field>