Primary Key Specifics

It is possible to have two types of primary keys (Identity) in Entity Developer:

Simple primary key (in Telerik Data Access terminology: single field identity). To define a property as a simple primary key, select the Primary Key check box in the Property Editor dialog. For simple primary keys, you can select a generator from the Generator drop-down list.
Composite primary key (in Telerik Data Access terminology: composite identity). It is possible to have more than one primary key property within a class. However, you can set a generator only for one key property.

Entity Developer for Telerik Data Access provides a special mechanism for numeric sequence generator. Generators are used for generating number sequences for key fields. There are a few types of generators like increment, identity, sequence, hilo, etc. Some of them generate simple numbers that are based on DB sequences and identity fields, and others generate identifiers based on special algorithms. Generators are not used for composite and complex type composite primary keys.

Below is the description of generators available in the Generator drop-down list:

 

ExpandedToggleIcon        Primary Key Generators

Generator

Description

Default

The generator used for the whole model. Note that default generator for all properties in the model can be defined by selecting the appropriate value in the Default Identity Generator line of the model's properties and can be redefined for any specific property.

Autoinc

Uses an AUTOINC generator.

Guid

Uses a new System.Guid as the identifier.

IncrementalGuid

Uses a generator that generates a Guid that is larger than any Guid previously generated for the connected database. Telerik Data Access uses a special table in the database, by default it has the name 'voa_keygen' for this generator. You can change the name of the table on the Configuration page of Model settings in the HighLow Key Generator group.

Hilo

Uses a hi/lo algorithm to efficiently generate identifiers of any integral type. This is the generator used by Telerik Data Access by default when no other generator is specified on both model and property level. Telerik Data Access uses a special table in the database, by default it has the name 'voa_keygen' for this generator. You can change the name of the table on the Configuration page of Model settings in the HighLow Key Generator group.

Verify

Uses a  the 'Verify' key generator.

 

ExpandedToggleIcon        See Also


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.