user manual
iv
Constructing finder methods . . . . . . 137
Constructing the where clause . . . . . 138
Parameter substitution . . . . . . . . . 138
Compound parameters . . . . . . . . . 139
Entity beans as parameters. . . . . . . 139
Specifying relationships between entities 140
Container-managed field names . . . . 142
Setting Properties . . . . . . . . . . . . . . . 142
Using the Deployment Descriptor Editor . . 142
J2EE 1.2 Entity Bean using BMP or CMP 1.1
143
Container-managed data access support . 144
Using SQL keywords . . . . . . . . . . 144
Using null values . . . . . . . . . . . . 145
Establishing a database connection . . 145
Container-created tables . . . . . . . . 145
Mapping Java types to SQL types . . . 146
Automatic table mapping . . . . . . . . . . 147
Chapter 15
Entity Beans and Table Mapping for
CMP 2.0 149
Entity Beans . . . . . . . . . . . . . . . . . . 149
Container-managed persistence and Relationships
150
Packaging Requirements. . . . . . . . . . 150
A note on reentrancy . . . . . . . . . . . . 151
Container-Managed Persistence in Borland
Enterprise Server . . . . . . . . . . . . . . 152
About the Persistence Manager . . . . . . 152
Borland CMP engine's CMP 2.0 implementation
153
Optimistic Concurrency Behavior . . . . . 153
Pessimistic Behavior . . . . . . . . . . 154
Optimistic Concurrency . . . . . . . . . 154
SelectForUpdate . . . . . . . . . . . . 155
SelectForUpdateNoWAIT . . . . . . . . 155
UpdateAllFields . . . . . . . . . . . . . 155
UpdateModifiedFields. . . . . . . . . . 155
VerifyModifiedFields. . . . . . . . . . . 155
VerifyAllFields . . . . . . . . . . . . . 156
Persistence Schema . . . . . . . . . . . . 156
Specifying tables and datasources . . . 156
Basic Mapping of CMP fields to columns 158
Mapping one field to multiple columns . 158
Mapping CMP fields to multiple tables . 159
Specifying relationships between tables 160
Using cascade delete and database cascade
delete . . . . . . . . . . . . . . . . . . . 164
Database cascade delete support . . . . 165
Chapter 16
Using BES Properties for CMP 2.x 167
Setting Properties. . . . . . . . . . . . . . . . 167
Using the Deployment Descriptor Editor. . . 167
The EJB Designer . . . . . . . . . . . . . . 168
J2EE 1.3 Entity Bean . . . . . . . . . . . 168
Setting CMP 2.x Properties . . . . . . . . . 169
Editing Entity properties . . . . . . . . . . . 169
Editing Table and Column properties . . . . 170
Entity Properties . . . . . . . . . . . . . . . 172
Table Properties . . . . . . . . . . . . . . . 174
Column Properties. . . . . . . . . . . . . . 177
Security Properties . . . . . . . . . . . . . 178
Chapter 17
EJB-QL and Data Access Support 179
Selecting a CMP Field or Collection of CMP Fields
179
Selecting a ResultSet . . . . . . . . . . . . 180
Aggregate Functions in EJB-QL . . . . . . . . 180
Data Type Returns for Aggregate Functions. 181
Support for ORDER BY. . . . . . . . . . . . . 182
Support for GROUP BY. . . . . . . . . . . . .183
Sub-Queries . . . . . . . . . . . . . . . . . . 184
Dynamic Queries . . . . . . . . . . . . . . . . 184
Overriding SQL generated from EJB-QL by the
CMP engine . . . . . . . . . . . . . . . . 185
Container-managed data access support. . . . 187
Support for Oracle Large Objects (LOBs) . . 188
Container-created tables. . . . . . . . . . . 188
Chapter 18
Generating Entity Bean Primary Keys
191
Generating primary keys from a user class . . . 192
Generating primary keys from a custom class . 192
Implementing primary key generation by the CMP
engine . . . . . . . . . . . . . . . . . . . . . 192
Oracle Sequences: using
getPrimaryKeyBeforeInsertSql . . . . . . . . 192
SQL Server: using getPrimaryKeyAfterInsertSql
and ignoreOnInsert . . . . . . . . . . . . . 193
JDataStore JDBC3: using useGetGeneratedKeys. .
193
Automatic primary key generation using named
sequence tables . . . . . . . . . . . . . . 193










