Entities

The entity as the central model object has several functions in DataView. On the one hand you use the entity to manage user data with the same characteristics in a master table, on the other hand you can use the entity to create -> views in the database, in order to set up task-specific user views on user data in tables. Additionally, entities can be used to integrate -> foreign tables into the data model or to provide a logical -> zero- entity.

In contrast to other model objects, the entity can be mapped in the database both as a table (master table) or as a view, respectively. Both database objects can use the DataView format or a foreign format. The setting is done in the field Type.

Entry Comment Confer
T Mapped as DataView table -> Table Formats
F Mapped as foreign format table
V Mapped as DataView view -> View Formats
W Mapped as foreign view

If the mapping is done using the -> DataView Format both the table and the view contain DataView-internal system fields in addition to the application-specific attribute fields. DataView automatically assigns an internal C_ID for unique identification to each record which will be subsequently entered in the table.

For the representation on the desktop you can first create a default list or a default form. Both masks display the fields contained in the master table or in the view and provide the standard functionality required to enter new records, to search, to modify, to display dependent data, etc.

Example: In the meditronic application an Item entity has been created to manage all items. The master attributes number, identifier and price are used as common features. The master table was created using the DataView format in the database. On the desktop a default list and a default form are used as first masks to input test data.

How to create an Entity:

  1. Open the Entity Data form and enter a new entity record.

    Field Comment Confer
    Entity Name Here you enter the entity name. -
    Table/View Name Here you enter the name of the database obejct to be created (master table or view). -
    Mapping Type Select whether the entity is to be mapped as a table or as a view in the database. -> Table Formats
    -> View Formats
    Default List
    Default Form
    Here you enter the names of the default and master masks to be created (this is optional, specification of the list is recommended). -
    Title The object title is used in error messages and is required for selecting the main entity in the dynamic query mask.

  2. Change into the Table Fields sub-list and enter a new field record for each desired master attribute field.

    Please observe the following comments when you enter the database-relevant field attributes. If you want to create a view, the Table Fields sub-list will display fields attributes different from the ones described here. Further information can be found in -> view fields.

    Field Comment Confer
    Field Name Here you enter the field name using the syntax TABLENAME.COLUMNNAME. The input is supported by automatically prompting TABLENAME. As COLUMNNAME C_NAME is recommended. -> Table Fields
    Sequence Here you define the position number of the field. This determines the field sequence in the master table and in the default masks. -> Sequence of Fields in Tables
    Type Here you select the field data type. When you leave the field, the default length will automatically be added. It can be changed. -> Field Types
    Foreign Key Flag (for Foreign Format Tables only) Set this flag if the field is to be used as key field in foreign format tables. Each foreign format table needs at least one such key field, e.g. a number field). -> Tables in Foreign Format
    Index 1-3 Here you enter an index label using the syntax TABLENAME_INDEXNAME if the field is used to identify records uniquely or if you want to speed up queries on that field. For INDEXNAME S_NAME is recommended. (Indexing not possible for multi-lingual fields). -> Indexed Fields
    Uniqueness 1-3 Set this flag if you want to prevent similar entries in the field (uniqueness only possible for indexed fields). -> Unique Fields
    Multilinguality Here you select the languages for which the field in the table is to be created as multi-lingual. -> Multilingual Table Fields
    Mode Here you select the field-specific case-sensitivity for queries. -> Field-Specific Query Mode
    Non-Zero-Flag Set this flag if you want to force an entry into that field (compulsory field). -> Non-Zero Fields

    The following field attributes are optional. The details are important if the fields are used in masks. They are evaluated when the default master masks are created. You can overwrite these attributes when you refine the mask design later:

    Field Comment Confer
    Field Title Here you can enter a field title. It appears as column title in lists and as field title in forms. -> Field Title
    Description Here you can enter a help text for the field. When the field is edited, it will appear in the mask footer. -> Description for Fields
    Check String Here you can enter a character string to check the syntax of field entries. -> Check Strings for Field Entries
    Default Entry Here you specify the default value of the field. -> Assigning Default Values to Fields

    After saving the data for the entity object are stored in the repository. All created master table fields can be viewed in the Field Data form.

  3. Change into the Entity Data header form and create the master table / the view via Create Table/View.

    After that the master table or the view will exist in the database.

  4. Create the default master list or the form via Create List or Create Form (creating the list is recommended).

    After that the data of the default master masks are stored in the repository and copied into main memory. The default masks and their corresponding mask-field relations can be viewed in the Mask Data form.

    Note! You can immediately open a created default master list via the Manager menu (-> Open -> Application -> Select list) and enter test data. Thus you check that the object and the master attribute fields have been correctly created.