Introduction
An entity stores all the HTML pieces of Xelence, which includes logic and rules. In order to create a form, or create queries, methods, or any properties, an entity must already exist.
You can create entities in Xelence with different methods. One of these methods is with data from Microsoft Excel. This creates entities and their corresponding database tables.
Prerequisites
- An entity with the same name must not already exist.
- Make sure the folder in which you want to save your entity, already exists else create one.
|
Quick Steps |
| 1 |
Click the Create New Item icon |
| 2 |
Select the File Type |
| 3 |
Select the creation method |
| 4 |
Select the Excel file |
| 5 |
Select the tables, then click Next |
| 6 |
Enter the entity details |
| 7 |
Configure the column properties, then click Next |
| 8 |
View the relationships, then click Finish |
| 9 |
View the summary report, then click OK |
Detailed Steps
Step 1. Click the Create New Item icon.
This opens a dropdown list from which you can select an object to begin its item wizard. The item wizard creates a file or files.
Step 2. Select the File Type.
The file type identifies the type of file the wizard will create. In this case, you are creating an entity.
Step 3. Select the creation method.
This is how you are creating the entity. Here, you are creating an entity with an excel sheet.
Step 4. Select the Excel file.
In the Excel sheet, each tabsheet is a table.
Upload the Excel file you want to use.
Step 5. Select the tables, then click Next.
Select the table or tables (tabsheets) you want to use (one for each entity).
Step 6. Enter the Entity Details.
Enter the entity details. The important properties are:
- Entity Name (ID): Programmatic name of the entity.
- Folder: Specifies the location for the entity. If the folder you want to use doesn't exist, you can create it in the Solution Explorer.
- Description: You can also add a description if your entity requires any explanation.
- Table Name: Programmatic name of the table. When you enter the Entity Name, this populates as SGT_[table name].
- Drop and Create Table: If checked, this first deletes the existing table in the database and then creates a new table based on the entity configuration.
- Add New Primary Key Column: If checked, it automatically adds a column and the preview application will use it to identify the table row. This option is not visible, if the key is selected from the existing column names.
Tip: You can place multiple entities into a single folder, if desired.
Step 7. Configure the Column Properties, then click Next.
The important properties are:
- Sheet Column Name: The column name as it appears in the Microsoft Excel tabsheet.
- Key: The table column that the Preview application will use to identify the table row to express as a record. It defaults to the primary key.
- Column Name: The column name from the database table. Xelence will link this to the attribute name and pull it wherever the user refers to the attribute.
- Attribute ID: Name of the attribute. This is the meaningful name Xelence will use everywhere it refers to the attribute (such as in rules), and therefore the mapped database column. For example, the attribute might be Middle Name; Xelence will pull the database column wherever the user refers to Middle Name throughout the entity.
- Datatype: Type of C# data that can be stored in the column (int, string, datetime, etc.).
- UDT: User Data Type, if defined in the application, can be mapped to the table column at the time of entity creation.
- PickList: The system populates the list with values from the code table.
- Length: Maximum length allowed if the datatype is varchar.
- Allow Nulls: Indicates if the column can contain null values.
- Auto Increment: Allows a unique number to be generated automatically when a new record is inserted into a table.
Open the next tab to enter the details of the next entity.
Open the next tab to enter the details of the next entity, then click Next.
Step 8. View the relationships, then click Finish.
You can view the relationships based on your table structure.
Xelence will populate the one to one and one to many relationships it expects. You can remove relationships, if desired. If an entity has a one to one relationship, it is a child of that entity. For example, an order can only have one customer.
If an entity has a one to many relationship, it is a parent to that entity. For example, a customer can have more than one order.
Step 9. View the summary report, then click OK.
Xelence displays a summary of the tables it created. Close the popup and begin working with the entities. Xelence creates an entity for each selected tabsheet and a database table for each entity. For each table, it inserts the data from the respective tabsheet.
When you have completed the wizard and created your entities, it should look something like this:
#Xelence
#Entity