Entity relation is similar to database foreign keys, except they could be created in configuration without having corresponded relation in database (without Database Data Mapping).

This feature is very useful for linking SQL views to entities to pass additional fields or data (that can't be reached by LINQ to SQL formulas or if formula have a poor performance) to Queries.

Also check Business Logic Placement chapter for details on using SQL views.


To add,edit or delete relation press corresponding button.

Notice that not all of the properties are available in Properties window.


Changes in Database section would not be transfered to database. See Code Cruiser Development Cycle for details.


Entity Relation properties


Section

Name

Description

Basic

Name

Entity name. Should be machine friendly.

Basic

Type

Could be one-to-many or one-to-one.

One-to-one is very useful to glue additional data to the entity (data could be another entity or an SQL view) to use in Queries (without right joins).

Also check Business Logic Placement chapter for details on SQL view.

Basic

Primary Entity

Primary entity. For example for StatusId field Status entity would be Primary.

Basic

Foreign Entity List Field

If checked a list property of type Foreign Entity would be created for Primary Entity.

Database

Data Mapping - On Delete

Option on delete for database.

Database

Data Mapping - On Update

Option on update for database.

Database

Data Mapping - Name

Foreign key name in database.

Database

Data Mapping - System Named

Means that this FK was created in database without implicitly specifying its name.

Created with the Personal Edition of HelpNDoc: Easily create Qt Help files