Define the possible strategies to set the Primary Key values
Namespace: Castle.ActiveRecord
Assembly: Castle.ActiveRecord (in Castle.ActiveRecord.dll)
Version: 1.0.3.0
Syntax
| C# |
|---|
[SerializableAttribute] public enum PrimaryKeyType |
Members
| Member name | Description | |
|---|---|---|
| Identity |
Use Identity column (auto number)
Note: This force an immediate call to the DB when Create() is called
| |
| Sequence |
Use a sequence
| |
| HiLo |
Use the HiLo algorithm to get the next value
| |
| SeqHiLo |
Use a sequence and a HiLo algorithm - better performance on Oracle
| |
| UuidHex |
Use the hex representation of a unique identifier
| |
| UuidString |
Use the string representation of a unique identifier
| |
| Guid |
Generate a Guid for the primary key
Note: You should prefer using GuidComb over this value.
| |
| GuidComb |
Generate a Guid in sequence, so it will have better insert performance in the DB.
| |
| Native |
Use an identity or sequence if supported by the database, otherwise, use the HiLo algorithm
| |
| Assigned |
The primary key value is always assigned.
Note: using this you will lose the ability to call Save(), and will need to call Create() or Update()
explicitly.
| |
| Foreign |
This is a foreign key to another table
| |
| Counter |
Returns a Int64 constructed from the system
time and a counter value.
| |
| Increment |
Returns a Int64, constructed by counting from
the maximum primary key value at startup.
| |
| Custom |
A custom generator will be provided. See CustomGenerator |
See Also
Castle.ActiveRecord Namespace