Configuring concurrency control  Specifying finder- and ejbSelect-method queries

Chapter 27: Creating Entity Components

Setting field-mapping properties

Field-mapping properties specify which table columns correspond to the component’s container-managed fields, the primary key (which may map to one or several columns), and the timestamp (if used for concurrency control). Before configuring field mappings, make sure that:

Configure field-mapping properties in the Component Properties dialog box, on the Persistence/Field Mapping subtab. This subtab displays a mapping for each container-managed field (based on the state datatype structure fields), the key fields, and the timestamp column (if specified). The initial mappings use default values which you may need to adjust.

NoteRefreshing the field-mapping properties If you do not see mappings for all fields:

  1. Verify that the state type, primary key, and timestamp have been configured.

  2. Click Ok in the Component Properties dialog box to save the properties.

  3. Reopen the Component Properties dialog box.

Field mapping format

The mapping for each field has the form:

column[typespec]

Where:

NoteOverriding the default database column names For entity beans imported from an EJB-JAR file, the default field mappings use quoted database column names to avoid conflicts with database reserved words. In some cases, you may find that the quoted names exceed the maximum allowed for column names in the database. In this case, you can modify the column names after deploying, or add a sybase-easerver-config.xml file to your EJB-JAR file to set the field mapping properties before deploying. If you use quoted column names in the XML file, be sure to use the quote entity (") in place of quotes in property value strings.

For information on creating an sybase-easerver-config.xml file, see “Using EAServer configuration files in J2EE archives” in Chapter 9, “Importing and Exporting Application Components,” in the EAServer System Administration Guide.





Copyright © 2005. Sybase Inc. All rights reserved. Specifying finder- and ejbSelect-method queries