@ejbgen:automatic-key-generation Annotation

For a CMP entity bean, specifies how primary keys are auto-generated. Primary keys can be auto-generated using Oracle or SQL server specific methods or a vendor-neutral named sequence table. A summary of the syntax is provided below. For detailed explanations and examples, see the related topics at the bottom of the page.

Scope

Class tag for a CMP entity bean.

Syntax

@ejbgen:automatic-key-generation

type="keyGeneratorType"

[name="nameKeyGenerator"]

[cache-size="keyChacheSize"]

Attributes

type

Required. The following key generator keywords are available:

Note. The SQLServer2000 option is the same as SQLServer, except that SQLServer uses @@IDENTITY column to get the generated key value and SQLServer2000 uses the SCOPE_IDENTITY() function instead.

cache-size

Optional. Specifies the size of the key cache.

name

Optional. Specifies the name of the Oracle SEQUENCE table or the name of the named sequence table.

Remarks

The following rules apply to this tag's use:

Related Topics

Automatic Primary Key Generation

Automatic Primary Key Generation Sample