Creating Entities
Creating entities within Applipress involves a straightforward process that allows for the customization and specification of data models for your application. Here’s how to create an entity:
-
To begin, navigate to the "Entities" menu and click on the "Create Entity" button.
-
Select the 'Lookup' entity template and enter the name of the entity as 'Customer'. Then, click on the "Create" button. The Lookup template is an excellent choice for entities that will be used as lookup tables, such as for customers, products, etc.
-
After the entity has been created, you will be redirected to the entity editing page. Here, you can view details of the entity, including fields, relationships, and other settings.
-
The Lookup template automatically generates fields commonly used for lookup tables. These include
code
,name
,description
,seq
,status
,validFrom
, andvalidUntil
. -
A brief explanation of these fields:
-
code
: A field that contains a code or identifier for the entity, usually uniquely identifying the entity. -
name
: A field that contains the name of the entity. -
description
: A field that provides a description of the entity. -
seq
: A field that contains the sequence number of the entity, used for sorting entities when not sorting alphabetically or by primary key. -
status
: A field indicating the entity's status, typically used to mark the entity as active or inactive. -
validFrom
: A field indicating the date from which the entity is active. -
validUntil
: A field indicating the date until which the entity is active. -
The
id
field, although not listed among these fields, will be automatically created and serve as the primary key of the entity.
-
-
In addition to these template-generated fields, you can add other fields, change field settings, add relationships, and modify entity settings as needed.
-
Once you have finished configuring the entity, click on the "Save" button to save your changes.
Generating the Entity
After creating and configuring the entity, you can proceed to generate the entity's source code. To do this, follow these steps:
-
Click on the "Generate entity" button located in the upper left corner of the entity editing page.
-
After the generation process is complete, a "Show generation result" button will appear. Click on this button to view the details of the application generation process.
-
The generation result page provides information about the entity generation process, including any errors or warnings that may have occurred during the generation.
-
After generating a new entity, the backend application have to be restarted to apply the changes. This will apply new liquibase scripts to the database and make the new entity available in the application.
By following these steps, you can create and generate entities within Applipress, allowing you to define and manage the data models for your application with ease.