page header

How to add/edit a relationship

Adding a new relationship

When working database-first, reverse engineering Tables to Entity Definitions will automatically reverse engineer the foreign key constraints between the tables involved to relationships between the created and existing entity definitions. By default, only normal relationships (1:1/m:1/1:n) will be added through reverse engineering from relational model data. Many-to-many relationships are only added through reverse engineering if the Project Setting Auto add many to many relationships is set to true (default is false). Relationships added through database-first techniques will automatically set the Update/Delete cascade rules with the values defined on the backing Foreign Key Constraint.

To manually add a relationship between two entities, use one of the following options:

Adding a normal relationship also means: specifying the foreign key fields related to the primary key fields (or use the default, which means auto-generate the foreign key fields) and specify the navigator names for both sides.

Edit a relationship

To edit a relationship, right-click the relationship in the Project Explorer and select Edit... from the context menu, or press cntrl-shift-O while a relationship node is selected. Editing a relationship doesn't allow you to specify which entities are involved, but does allow you to specify the foreign key fields, alter the quantity indication per side and edit the navigators.

Mark a normal relationship as 'Model-only'

To mark a normal relationship as model-only (so it doesn't require a backing Foreign Key constraint in the relational model data), you can either right-click it in the Project Explorer and select 'Is Model-Only' to toggle the model-only setting on the relationship or check the checkbox in the Normal Relationship Editor. You can also specify the suffix 'mo' after the relationship definition in Quick Model or right-click the relationship in the ModelView editor.

Editing Update / Delete cascade rules

Every normal relationship defines Update / Delete cascade rules. These rules are initially set to either the value defined on the backing Foreign Key constraint (when they're a product of reverse engineering using database-first functionality) or to the values defined in the  Project Setting Default relationship delete rule action and Default relationship update rule action. The Normal Relationship Editor allows you to alter the values for the Update and Delete cascade rules. Changing the values for these rules will update a backing Foreign Key constraint with the same values when you validate your project using 'Validate and adjust relational model data'.


LLBLGen Pro/a> Designer v4.0 documentation. ©2002-2013 Solutions Design