Chapter 27: Creating Entity Components
If you are developing EJB entity beans, use an EJB development tool to create an EJB-JAR file that defines the components’ CMP fields and container-managed relationships. You can define CMP entity beans in EAServer Manager, but it may be easier with a dedicated EJB development tool.
EAServer includes a sample EJB 2.0 CMP entity bean, in the installation subdirectory html/classes/Sample/cmp20sample. See the readme.txt file in this directory for instructions on deploying and running the sample.
When you have CMP entity beans defined in an EJB-JAR file, import the EJB-JAR file into EAServer as described in Chapter 9, “Importing and Exporting Application Components,” in the EAServer System Administration Guide. The JAR importer configures appropriate defaults for almost all settings. After importing, review the persistence settings described below and verify that they are correct.
To use automatic persistence for non-EJB entity components, you must configure the persistence properties in EAServer Manager.
Component properties for automatic persistence are configured on the Persistence tab in the Component Properties dialog box. This tab has subtabs to display the categorized properties.
Configuring automatic persistence
Specifying the CMP version for EJB 2.0 entity beans.
Setting Persistence/General subtab properties.
Enabling automatic key generation if your entity component uses a table with an automatically generated key or your EJB entity bean uses java.lang.Object as the primary key class.
Creating database tables.
Configuring concurrency control.
Setting field-mapping properties.
Specifying finder- and ejbSelect-method queries.
Configuring table-mapping properties.
Using relationship components if using EJB 2.0 container-managed relationships.
After you have verified the deployment is working, you can optimize your component’s performance by configuring in-memory caching of instance data and query results. For more information, see “Entity instance and query caching” in the EAServer Performance and Tuning Guide.
|Copyright © 2005. Sybase Inc. All rights reserved.|