Entity Editor
The Entity Editor is the editor which allows you to alter any aspect of
an entity definition: its fields, its inheritance information, its
mappings and its code generation information. You open an entity in its
Entity Editor by selecting it in the Project Explorer and then right-clicking it and selecting
'Edit...', or by pressing Ctrl-Shift-O
.
The entity editor consists of the following main parts:
- Fields tab
- This tab contains the information and editors for working with the fields of the entity, the unique constraints defined over these fields and the Fields mapped onto Related Fields
- Field mappings tab
- This tab contains the information and editors for working with the mappings of the entity definition on a target element in the Relational Model Data, e.g. a table or a view.
- Inheritance info tab
- This tab contains the information and editors for working with the inheritance hierarchy the entity is in, editing discriminator information and inheritance hierarchy types. Tab is disabled if the entity isn't in an inheritance hierarchy
- Code generation Info tab
- This tab contains the information and editors for the code generation related data of the entity and its containing elements.
At the top of the Entity Editor you'll find the following editor elements:
- Entity name
- This is the name of the entity
- Group name
- This is the name of the group the entity is in. You can select an existing one or specify a new one. If left empty, the entity is in the unnamed group
- Identifying fields
- These are the fields (one or more) which form the primary key or identifying fields for the entity. Most target frameworks supported by LLBLGen Pro require that every entity has at least one field set as Identifying Field and it is good practice to have at least one field as Identifying Field. To specify the identifying fields for an entity, click the Edit... button next to the Identifying Fields textbox.An alternative is to select the fields in the Project Explorer, right-click them and select Select Selected Fields as Identifying Fields in the context menu. Only fields which are allowed as identifying fields are selectable as identifying field: optional fields and fields which have a Value Type Definition as their type aren't allowed as Identifying fields.
- Subtype specification
- To specify the supertype of an entity, you can select it from this combo-box. If an entity isn't in an inheritance hierarchy, the combo box shows <None>.
- Is abstract specification
- If an entity is in an inheritance hierarchy, it can be marked as abstract. This means that in the generated code, it's not possible to create an instance of the generated type, only of the subtypes. It is therefore only useful to mark an entity as abstract if an instance of it doesn't really means anything, while instances of its subtypes do mean something.
The General Entity Editor
The designer also offers a General Entity Editor. This is a special kind of entity editor which allows you to edit the entity which is currently selected in the project explorer. This editor is opened by selecting Project -> General Entity Editor in the menu, or by clicking the button in the toolbar.
The advantage of the General Entity Editor is that it keeps the current sub tab selected when you select another entity in the project explorer, which allows you to e.g. edit the mappings of several entities without a lot of clicking through tabs.