Your entity's relationship with its data and the data from other entities is determined by its table's keys. There are two keys to be aware of:
The table's primary key is what your app will use to identify individual records in that table. It is a unique sequential identifer for each table row. You must click the key icon next to the column you want to use as the primary key when you create the entity.
The table's foreign key is what Xelence will use to determine your entity's relationship with other entities. If your entity contains a column whose ID is the same as another entity's primary key, that column will function as the foreign key. This means your entity is the child of the entity that uses that column as its primary key, and therefore has a one to one relationship with that entity. Conversely, the entity with that primary key is the parent of your entity, and has a one to many relationship with your entity.
For example, your app might have an entity for Customers and an entity for Orders: entCustomer and entOrder. entCustomer uses the customer_id column as its primary key. entOrder uses the order_id column as its primary key, and it also contains a column for customer_id to identify the customer to whom an individual order belongs. This is the entOrder's foreign key. entCustomer is the parent entity of entOrder; entOrder is a child entity of entCustomer. entCustomer has a one to many relationship with entOrder; entOrder has a one to one relationship with entCustomer.
If you are creating related entities via Excel file, there is no user action you need to take to indicate an entity's foreign key. As long as a column's ID matches the primary key of another entity, Xelence will default to the relationship. Otherwise, you can manually maintain these relationships during entity creation or after the entity exists.
This post is part of the Entity topic. Click here to open the Entity Overview.
#Entity
#ControlsButtons