Class Sequence
Utility functions for getting primary keys. Keys are "burned" permanently and cannot be re-used. Key reservation is a potential bottleneck, so if you know in advance how many keys you will need, you should reserve them in one call.
Inherited Members
Namespace: SuperOffice.Data
Assembly: SoDataBase.dll
Syntax
public static class Sequence
Methods
GetNext(SoTable)
Get the next primary key for a table given the definition of a table
Declaration
public static int GetNext(SoTable soTable)
Parameters
Type | Name | Description |
---|---|---|
SoTable | soTable | Defininition of the table from the runtime dictionary |
Returns
Type | Description |
---|---|
int | New (e.g. next) primary key value, given information about a table table. |
GetNext(SoTable, int)
Get the next primary key range for a table given the definition of a table
Declaration
public static int GetNext(SoTable soTable, int count)
Parameters
Type | Name | Description |
---|---|---|
SoTable | soTable | Defininition of the table from the runtime dictionary |
int | count | Number of records to reserve keys for |
Returns
Type | Description |
---|---|
int | The first new key of the desired range |
GetNext(TableInfo)
Get the next primary key for a given table .
Declaration
public static int GetNext(TableInfo tableInfo)
Parameters
Type | Name | Description |
---|---|---|
TableInfo | tableInfo | TableInfo object representing the table. |
Returns
Type | Description |
---|---|
int | New (e.g. next) primary key value |
GetNext(TableInfo, int)
Get the next primary key range for a given table .
Declaration
public static int GetNext(TableInfo tableInfo, int count)
Parameters
Type | Name | Description |
---|---|---|
TableInfo | tableInfo | TableInfo object representing the table. |
int | count | Number of records to reserve keys for |
Returns
Type | Description |
---|---|
int | The first new key of the desired range |
GetNext(int, int)
Reserve a set of new id's from the sequence table, given the tables sequence number.
Declaration
[Obsolete("Please use an overload taking TableInfo or SoTable; not all tables have a sequence number! - the overloads will handle those as well.", false)]
public static int GetNext(int sequenceID, int count)
Parameters
Type | Name | Description |
---|---|---|
int | sequenceID | Sequence id of the table. |
int | count | Number of new sequence id's to reserve |
Returns
Type | Description |
---|---|
int | First id of the range. |
GetNextBatch(PKContainer)
Collect several new primary keys for new row objects held by the PKContainer.
Declaration
public static void GetNextBatch(PKContainer pkContainer)
Parameters
Type | Name | Description |
---|---|---|
PKContainer | pkContainer | Object holding information about inserts in need of next sequence id's |