user manual
Chapter 17: EJB-QL and Data Access Support 179
Chapter
17
Chapter17EJB-QL and Data Access
Support
EJB-QL allows you to specify queries in an object oriented query language,
EJB-QL. The Borland CMP engine translates these queries into SQL queries.
The Borland Enterprise Server provides some extensions to the EJB-QL
functionality described in the Sun Microsystems EJB 2.x Specification.
Important For documentation updates, go to www.borland.com/techpubs/bes.
Selecting a CMP Field or Collection of CMP Fields
When only one cmp-field of an otherwise large EJB is required, you can use
EJB-QL to select a single instance of collection of that cmp-field. Using EJB-
QL in this way improves application performance by eliminating the need to
load an entire EJB. For example, this query method selects only the balance
field from the Account table:
<query>
<query-method>
<method-name>ejbSelectBalanceOfAccountLineItem</method-name>
<method-params>
<method-param>java.lang.Long</method-param>
</method-params>
</query-method>
<result-type-mapping>Local</result-type-mapping>
<ejb-ql>SELECT l.balance FROM Account a, IN (a.accountLineItem) l WHERE










