Skip to main content

1 Entities Setup

Entities are the essential data structure of an application. They are used to store, manipulate, and query data within the app database.

The Entity is where the data is stored. Every entity has its own data table IQueryable<TEntity> representation in the Database parameter: db.{nameOfEntity}Set.

Here is an example of the Ticket entity from the Support Ticket Tutorial:

Boot Camp - Ticket entity

Create an Entity

On the Entities banner, click (+) to create a new entry. Entities can be organized in folders; this has no implication on code access. Or type Ctrl + Shift + C to access the general create dialogue.

There are two pages to the Entity Create wizard.

Jetveo App Builder

General
Name - Name of the entity, used in the title of the Create and Detail pages
Name (plural) - Plural of the entity name, usually used in the title of List pages (generated automatically from Name)
Code Identifier - Code representation (i.e., no spaces) for the entity (generated automatically from Name)
Inherited Aspects - Sets of attributes and/or references that the entity will inherit. These are established in the Aspects section (see Section 3.1.3).

User Interface
Display Icon - Default icon for the entity that is used in page headers. Choose from dozens of icons.

Automatic Actions (1)
Create Display Attribute - Creates a text attribute that will be used as a display expression. Usually used to create the Name attribute.

Click Next

Jetveo App Builder

Automatic Actions (2)
Create Pages - Automatically create selected pages that will be used in the User Interface section: Create Page, Detail Page, and/or List Page. Unselect the individual pages if they are not necessary.
Create State Machine - Select a codebook to be used as a state machine for the entity. State machines are used to define workflows; they are established in the Business section (see Section 3.3.4).

Entity Attributes

After creating an entity you usually need to add some attributes that determine its properties in the database or within a string of characters in a display. Go to the Data Definition tab (the default setting).

Click “Add New Attribute” to add multiple attributes in one window.

Jetveo App Builder

Attribute Name — Type the name that will be used.
Type — Choose from String, Rich-text Markdown, Rich-text HTML, Integer, Decimal, Boolean, Date, Date and Time, Document, and User. The underlined letters that are shown in the user interface are shortcuts. Both “Date” and “Date and Time” can be set to allow null values.
Existing Attributes — Click to see the attributes that already exist to help you determine the necessity for additional ones in the grid above.

The settings are then as follows:

Jetveo App Builder

Name — The name for the attribute.
Code Identifier — The code for the attribute.
Type of Attribute — Select from String, Boolean, Date and Time, Rich-text Markdown, Rich-text HTML, Integer, Decimal, Boolean, DateTime, Integer, Decimal, Special – Document, and Special – User. Some options require additional information in the Closer Specification section below.
Closer Specification — Additional settings for some of the “Type of Attributes” above.
Default Value — Defines the expression that is evaluated when a new empty instance of an entity is created. The result is then assigned to the attribute. Example 1: a new piece of data may require the user to be attached with the following code: ctx.User. Example 2: a new piece of data may require a creation date and time with the following code: DateTime.Now. You can set a Default Value to be assigned to the attribute when a new entity record is created, and before Suggested Values from UI components are evaluated.

When the Attributes are created, there are some icons that may appear: the gear icon indicates the default; (x) deletes the attribute; and there is a cloning feature.

Entity References

References provide additional definition for the entities.

Click “Add New Reference”. This enables the user to create several references at the same time.

Jetveo App Builder - Add Reference Magic Wand

Reference Type — Select from the drop-down menu: Direct; Direct (nullable); Composition; Aggregation; Many-to-many; Codebook; or Codebook collection. The underlined letters that are shown in the user interface are shortcuts.
Target — Select the target for the reference from the drop-down menu.
Name — Enter the name to attach to this reference. A version of the value shown in "Target" is automatically generated (either singular or plural, depending on the type of reference).