Skip Headers

# Configuring Sequencing at the Project Level

Previous

Next

Sequencing allows TopLink to automatically assign the primary key or ID of an object when the object is inserted.

You configure TopLink sequencing at the project or session level to tell TopLink how to obtain sequence values: that is, what type of sequences to use.

In a CMP project, you do not configure a session directly: in this case, you must configure sequences at the project level. In a non-CMP project, you can configure a session directly: in this case, you can use a session-level sequence configuration to override project-level sequence configuration, on a session-by-session basis, if required (see "Configuring Sequencing at the Session Level").

Using TopLink Workbench (see "Using TopLink Workbench"), you can configure table sequencing (see "Table Sequencing") and native sequencing ("Native Sequencing With an Oracle Database Platform" and "Native Sequencing With a Non-Oracle Database Platform") and you can configure a preallocation size that applies to all sequences (see "Sequencing and Preallocation Size").

Using Java (see "Using Java"), you can configure any sequence type that TopLink supports ("Sequencing Types"). You can create any number and combination of sequences. You can create a sequence object explicitly or use the default sequence that the platform creates. You can associate the same sequence with more than one descriptor and you can configure a separate preallocation size for each descriptor's sequence.

If you are migrating a BEA WebLogic CMP application to OC4J and TopLink persistence (see "Migrating BEA WebLogic Persistence to OC4J TopLink Persistence" ), the TopLink migration tool does not migrate BEA WebLogic single column sequence tables to TopLink unary sequence tables (see "Unary Table Sequencing"). After migration, you must manually configure your project to use TopLink unary sequence tables if your application originally used single column sequence tables in BEA WebLogic.

After configuring the sequence type at the project (or session) level, to enable sequencing, you must configure a descriptor with a sequence field and a sequence name (see "Configuring Sequencing at the Descriptor Level").

For more information about sequencing, see "Understanding Sequencing in Relational Projects".

Note: Changing the project's default sequencing options does not affect descriptors that already exist in the project; only newly added descriptors are affected.