Primary key specifics

Entity Developer supports two types of primary keys (identities) in data models: simple primary keys and composite primary keys (identities composed of multiple properties).

Simple primary key

A simple primary key (also called single field identity in Telerik Data Access terminology) consists of a single property. To define a property as a simple primary key:

  1. Open the Property Editor dialog.
  2. Select Primary Key.
  3. Optional: Select a generator from the Generator dropdown list.

Composite primary key

A composite primary key (also called composite identity in Telerik Data Access terminology) consists of multiple properties within a single class. When using composite primary keys:

  • You can set a generator for only one key property.
  • Generators are not used for complex type composite primary keys.

Generators overview

Generators are special mechanisms used to automatically generate values for primary key fields, particularly for numeric sequences. Entity Developer for Telerik Data Access provides several generator types that use either database sequences, identity fields, or special algorithms.

Primary key generators

Generator Description
Default The generator used for the whole model. The default identity generator for all model properties can be configured in the model properties and overridden for individual properties.
Autoinc Uses the AUTOINC database generator.
Guid Generates a new System.Guid as the identifier.
IncrementalGuid Generates a Guid that is greater than any previously generated Guid for the database. Telerik Data Access uses a special table (default name: voa_keygen) for this generator. You can customize the table name in the model settings on the Configuration page under the HighLow Key Generator group.
Hilo Uses a hi/lo algorithm to efficiently generate identifiers of any integral type. This is the default generator in Telerik Data Access when no other generator is specified. Telerik Data Access uses a special table (default name: voa_keygen) for this generator. You can customize the table name in the model settings on the Configuration page under the HighLow Key Generator group.
Verify Uses the Verify key generator.

See also

  • Creating and editing properties
  • Configuration
  • Working with properties