Working with Sequencing

In TopLink, sequence numbers are artificial keys that uniquely identify the records in a table. When you define a sequence number field for a descriptor, TopLink automatically generates a new sequence number every time you insert a new record into the table.

Use the Sequencing area of a descriptor's Descriptor Info tab (see Figure 4-1) to specify sequencing information

Database tables often use a sequence number as the primary key. The TopLink Mapping editor can use the database's native support or a sequence table to maintain sequence numbers.


Tip: Oracle recommends using sequence numbers for primary keys because they are single, guaranteed, unique values.

Other data values may require composite primary keys to make up a unique value, which is less optimal. Additionally, non-artificial values may need to change, and this is not allowed for primary keys.


Related Topics

About TopLink Descriptors

Working with Descriptors
Setting Descriptor Information
Using Sequence Numbers with Entity Beans
Using Native Sequencing
Using Sequence Tables
Preallocating Sequence Numbers
Creating the Sequence Table on the Database

 

Copyright © 1997, 2004, Oracle. All rights reserved.