Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Developer's Guide

- Previous: Example 1
- Next: Example 3

### Example 2

This query returns all products in a specified price range. It defines two query parameters which are the lower and upper bound for the price: double low, double high. The filter compares the query parameters with the price field:

    low < price && price < high

Query ordering is set to `price ascending`.

The `finder` element of the `sun-ejb-jar.xml` file looks like this:

    <finder>
       <method-name>findInRange</method-name>
       <query-params>double low, double high</query-params>
       <query-filter>low &lt; price &amp;&amp; price &lt high</query-filter>
       <query-ordering>price ascending</query-ordering>
    </finder>

- Previous: Example 1
- Next: Example 3

- © 2010, Oracle Corporation and/or its affiliates