Oracle GlassFish Server 3.0.1 Application Development Guide

Example 3

This query returns all players having a higher salary than the player with the specified name. It defines a query parameter for the name java.lang.String name. Furthermore, it defines a variable to which the player’s salary is compared. It has the type of the persistence capable class that corresponds to the bean:

    mypackage.PlayerEJB_170160966_JDOState player

The filter compares the salary of the current player denoted by the this keyword with the salary of the player with the specified name:

    (this.salary > player.salary) && ( == name)

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

   <query-params>java.lang.String name</query-params>
      (this.salary &gt; player.salary) &amp;&amp; ( == name)
      mypackage.PlayerEJB_170160966_JDOState player