Skip to main content

IdFunction (Storage Keyword)

Specifies the system function to be used to assign new ID values for a persistent class using default storage.

Synopsis

<IdFunction>increment</IdFunction>

Value

The value of this element can be either increment (to use the $increment function) or sequence (to use the $sequence function).

Description

If a persistent class does not use an IdKey to determine object ID values, this element lets you specify the function used to assign ID values (either the $increment function or the $sequence function).

If the class uses the $increment function, new IDs are created by incrementing the value stored at the global location defined in the <IdLocation> element.

If the class uses the $sequence function, it may reserve blocks of IDs for greater speed in cases of rapid data ingestion. If not all of the reserved IDs are used, gaps in the ID numbers may result. These gaps may or may not be filled in when subsequent data is ingested. A side effect is that an instance of the class that has a higher ID is not necessarily newer than an instance of the class with a lower ID. In addition, the value at the global location defined in the <IdLocation> element is not directly related to any of the currently allocated IDs.

Default Value

The default value for the <IdFunction> element is increment for classes created using a class definition.

The default value for the <IdFunction> element is sequence for classes created using a DDL CREATE TABLE statement.

FeedbackOpens in a new tab