Enabling automatic key generation  Configuring concurrency control

Chapter 27: Creating Entity Components

Creating database tables

The entity component’s database table must be specified on the Table Name setting in the Persistence/General subtab.

Tables for binary storage

If you are using binary storage, simply enter the table name. If you have specified a valid database type in the connection cache properties, EAServer creates the table if it does not exist. “Table schema for binary storage” describes the required table schema.

Tables for mapped-fields storage

If you are using mapped-field storage, you can use actual database table names, or logical table names that do not necessarily exist in the database. You can map fields to several tables, in which case the table named on the Persistence/General tab becomes the “main” table.

Table access is configured by the component’s table mapping properties. The default mappings require that the tables exist and are accessed by standard SQL commands.

Use logical names if you must use stored procedures for data access, or are using a non-SQL database. You must configure the data access operations for logical tables, as described in “Configuring table-mapping properties”.

If you have specified a valid database type in the connection cache properties, EAServer creates database tables if they do not exist. Otherwise, you or your database administrator (DBA) must create tables manually.

NoteAutomatic table creation is for testing only For deployment to production servers, you or your DBA should create the tables, using an optimized index model and any other necessary optimizations, such as enabling row-level locking.

The table column types must agree with the mapped fields (see “Setting field-mapping properties”), and contain a timestamp column if timestamps are used for concurrency control. “Supported Java, IDL, and JDBC/SQL types” lists the supported JDBC/SQL types and the corresponding Java and IDL field types.





Copyright © 2005. Sybase Inc. All rights reserved. Configuring concurrency control