You can create a repository filter with the <rql-filter> tag in the definition file for an item descriptor. The <rql-filter> tag encloses an RQL statement, as in the following example:

<item-descriptor name="article">
  <rql-filter>
    <rql>name starts with "n"</rql>
  </rql-filter>
  <table name="article" id-column-names="article_id">
    <property name="name"/>
    <property name="date"/>
  </table>
</item-descriptor>

This setting causes queries and item lookups for this item descriptor to return only items whose name property starts with n. The SQL repository issues SQL in the form of an extra WHERE clause condition to implement filtering so any given query or item lookup should be no slower with a reasonable filter tacked on.

You can also use RQL substitution parameters in your filter query. For example:

<item-descriptor name="article">
  <rql-filter>
    <rql>name starts with ?0 or availabilityDate &lt; ?1</rql>
    <param value="n"></param>
    <param bean="/myApp.IssueDate"></param>
  </rql-filter>
  <table name="article" id-column-names="article_id">
    <property name="name"/>
    <property name="availabilityDate" data-type="timestamp"/>
  </table>
</item-descriptor>

In this example, the RQL parameters are substituted into the query:

For information about RQL, see the Repository Query Language section in the Repository Queries chapter.


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices