Primary Key Constraints

By default, the generated DDL for adding a primary key to a table takes the form:

alter table TTTT add primary key (AAAA)

where

TTTT is the table name.

AAAA is a comma-delimited list of the primary key attributes.

By specifying the command line option -usenamedprimarykeyconstraint through the extra.generator.options this DDL can be made take the form:

alter table TTT add constraint CCCC primary key
      (AAAA)

where

CCCC is the name of the primary key constraint.

In this case the name of the primary key constraint defaults to the same as the name of its corresponding table. Also, like primary key index names, a prefix can be applied to this name using the -primarykeyconstraintprefix command line option. If the constraint name length is greater than the SQL identifier limit supported by your database you will encounter an error during SQL processing.