Database Column Mapping

This section describes some of the column parameters that you can define when setting up the properties of entities in Entity Developer.

You can open the Column Editor dialog by clicking the column-mapping-ellipsis-button ellipsis button on the right side of the Column field or by pressing Alt+E keys in the following dialogs:

Class Editor
Complex Type Editor
Inheritance Editor
Property Editor

You can define the following parameters in the Column Editor dialog:

efc-column-editor

 

ExpandedToggleIcon        Mapping

The Mapping drop-down list sets the property mapping type to the column. For scalar properties, the value of this field is set to Custom mapping and cannot be changed. For properties of complex type, one of the following values can be selected:

Custom mapping - allows you to specify custom column names for property mapping.
Default mapping - is set for every property participating in a component. There are two main approaches to defining default mapping: you can keep the column name suggested by the application based on the naming rules defined in the model settings, or enter a different name for each column.
No mapping - excludes a property from mapping.

You can select mapping when you open a class editor and click the column-field-ellipsis-button ellipsis button on the right side of the Column field for a property that is contained in a complex type.

For more information, see Complex Type Mapping.

 

ExpandedToggleIcon        Column Name

By default, the column name is identical to the name of the corresponding property and follows the requirements defined in the naming sections of the Model Settings dialog. If, at some stage of model development, the naming rules or the name of the corresponding property is changed for any reason, the default column name is changed accordingly.

However, you can set a custom name for the column by entering it in the Column Name field. Additionally, you can prohibit the use of null values in a column (by selecting the Not Null checkbox) and to create a unique key constraint on a column (by selecting the Unique checkbox).

note Note

If the value of the Not Null checkbox is not specified explicitly, as shown in the screenshot earlier on this page, its value is calculated depending on the Nullable property value for the corresponding property.

 

ExpandedToggleIcon        Data Type Parameters

The Column Editor dialog, you can also make optional adjustments to the column data type.

The SQL Type field specifies the type of the column that is to be created in the database. If this parameter is set, the Fixed Length and Unicode checkboxes become unavailable.

If selected, the Fixed Length checkbox indicates that the column stores fixed-length data for CHAR, BIT or BINARY data types on the server side. A CHAR/BINARY column is created instead of VARCHAR/VARBINARY.

The Unicode checkbox can be used, for example, to specify that the string data type in the model is to be matched with the NCHAR or NVARCHAR types in the database.

note Note

If the value of the Unicode checkbox is not specified explicitly, its value is calculated based on the Default Unicode property value from the model property set. This value is displayed for this field.

The Length field sets the maximal length for values of character or binary data types (such as CHAR, VARCHAR, BINARY, VARBINARY, BIT etc.) on the server side.

note Note

If the value of the Length field is not specified explicitly, its value is calculated based on the Default Length property value from the model property set.

The Precision and Scale fields specify the exact parameters of numeric values, for example, of the DECIMAL type in Oracle. The Precision field specifies the total number of significant digits, while the Scale field specifies the number of digits to the right of the decimal point.

note Note

If the values of the Precision and Scale fields are not specified explicitly, their values are calculated based on the Default Precision and Default Scale property values from the model property set.

The Default Value field specifies the value to be used during generation of the database creation script by the Entity Framework Core runtime or Entity Developer itself and inserted into the database column.

The Unique Key field specifies the name of a unique constraint, which will include the column and be used during generation of the database creation script by the Entity Framework Core runtime or Entity Developer itself.

 

ExpandedToggleIcon        See Also


Send feedback on this topic

© 2008 - 2025 Devart. All rights reserved.