Linking Entities
One to Many / Many to One relationship between entities
BioT is a flexible platform that allows to define and store complex data structure that describe and facilitate your business process.
The following is an example describes a One to Many (OtM) relationship of a Device entity that points to many Log File entities.
Prerequisites
Follow the steps described here to create a new generic entity.
- For this example, we will name it Device Log.
- Add a File attribute to it and name it TXT Log File.
- Set the max file size to 10 MB.
Linking Entities
To define a link between 2 entities:
-
Login to BioT console and select the template you want link to another template (in our example the log file template).
-
Add a new attribute:
- Give the attribute a name (for example, Owner Device) that describes the relationship between the current entity and the entity this one points to.
- From the "Type" combo box, select "Entity"
- From the "Select Entity" combo box select the entity you would like to point to (For example, Device)
- In the "Referenced side attribute name" text box enter the name of the current entity as it will be named from the pointed entity. In other words how this attribute (Log Files) will be named when it is displayed under the Device entity.
- Save your changes.
What we have created is a One to Many relationship of many log files that point to a single device. When we expand the details of a specific device, a new tab will now appear that lists all the log files that "belong" to this device.
Advanced Data Structures
As in relational databases, you may also create more complex relationships between entities. For example if you would like to model a Many to Many (MoM) relationship, you can use a generic entity that will act as a junction entity between 2 other entities.
In this case you will have one connecting entity that lets you access all the medicines that a specific patient uses or all the patients that use a specific medicine.
Updated 11 months ago