Scope
Class
Multiplicity
(0..*): You can use this tag zero
or more times in any Java™ source
file that implements a CMP entity bean.
Purpose
This tag defines a set of query strings
expressed in EJB Query Language (EJB QL) to retrieve a set of value
objects. These query strings are used to retrieve the data and map
the results to generated value-objects. Each query string is enclosed
in square brackets ("[]") to denote the beginning and end of a query
string. All root objects of the queries should be cast to the correct
value-object, using the syntax below.
Example: [select {$DepartmentDeep} as d where d.deptno between 1 and 2]
[select in(d.emps) as e where e.salary >3]
Parameters
| Parameter |
Type |
Applicability |
Description |
Mandatory |
| name |
text |
All |
The abstract name of the query to retrieve a
set of value objects. The name must be unique to the module and must
be a valid Java identifier.
The name is used as the base name for a generated SDO class that
serves as the query root and itself contains references to the top-level
SDOs returned by the query. The name is also used as the base name
for the generated create, retrieve, update, and delete methods on
the session façade. |
true |
| query |
text |
All |
A set of query strings expressed in EJB QL.
These query strings are used to retrieve the data and map the results
to generated value-objects. Each query string is enclosed in square
brackets ("[]") to denote the beginning and end of a query string.
All root objects of the queries should be cast to the correct value-object. |
true |
| read-only |
Boolean |
All |
If true, indicates that only read methods should
be created on the session façade. Default is false. |
false |