🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Autoguid
This page was created by Henrik on 2018-01-16. Last edited by Wikiadmin on 2026-07-29.

You can use AutoGuid when you map an attribute in MDriven Designer to a database-generated GUID value; this page is for modelers working with persistence mapping.

What AutoGuid means

AutoGuid is a persistence-mapping setting for an attribute whose database value is a GUID generated by the database.

A GUID is an identifier value. In this context, AutoGuid describes how the value is generated in the database; it does not replace the attribute's GUID data type.

For example, if an entity has an identifier attribute named OrderId with the type Guid, AutoGuid means that the database generates the value for OrderId when the object is persisted.

When to use AutoGuid

Use AutoGuid when all of the following apply:

  • The attribute is represented as a GUID in the database.
  • You want the database, rather than your model logic, to generate that GUID.
  • You are configuring or reviewing the entity's persistence mapping.

Do not select AutoGuid only because an attribute has the Guid type. A GUID attribute can have a different value-generation approach; AutoGuid specifically represents database-generated values.

Relationship to persistence mapping

Persistence mapping defines how model attributes are represented in a database. AutoGuid is one part of that mapping.

For example, a model can contain an Order class and an OrderId attribute. The model defines the attribute and its type; the persistence mapping determines how that attribute is represented and generated in the database. With AutoGuid, the database is responsible for generating the GUID value.

Common attribute types

The following native attribute types are commonly used in a model and have corresponding database representations.

Attribute type Database representation described here Example use
String Size-limited text in the database. A customer name such as "Ada Lovelace".
Text Text in the database without a size limit. A long description or note.
Double Double-precision numeric value. A measured value such as 12.5.
Decimal Decimal numeric value. A value such as 19.95.
Integer Integer numeric value. A quantity such as 3.
DateTime Date and time value. A registration time.
Boolean True-or-false value. Whether an order is approved.
Blob Binary data (byte[]). Combine it with the BlobType setting. A stored binary document.
Guid GUID value. An identifier such as OrderId.

Guidance for new MDriven users

Persistence mapping is an advanced concern. If you are new to MDriven Designer, first learn how to define and execute your information model through Documentation:Start Introduction. Return to AutoGuid when you need to control how a GUID attribute is represented and generated in the database.

See also