About Entities
An entity is a database table, which you can use to store data. You can create queries to retrieve and manage data stored in entities. You can create events to trigger actions when data in an entity is changed. The following list provides a few examples on using entities:
- Enhance data that is used in an asset monitoring application
- Create applications related to customer relationship management
- Manage the workflow of an event-handling or a parts-ordering application
- Sort data retrieved from a maintenance or an issue-reporting application
- Store contact details of employees
Operations Hub provides a few baseline entities that you can use to manage your assets or collect machine data. You cannot modify or delete these entities; you can use them in your application directly. For baseline entities, the LAST UPDATED column is blank in the ENTITIES workspace.
- Define the entity structure. To do so, add fields and specify their data types (for example, Boolean, Number, String, and so on).
- Add rows, and specify field values. To do so, enter values manually or import data from a Microsoft Excel workbook.
Pivot Entity
A pivot entity is used to automatically collect data from multiple sensors that belong to selected devices and groups of devices. You can use a pivot entity in a query, and plot it as a trend graph in your application.
- : Indicates that the pivot entity is receiving data. If you want to stop collecting data in the pivot entity, you must deactivate the pivot entity. To do so, access the pivot entity, and then select .
- : Indicates that the pivot entity is not receiving data. If you want to start collecting data in the pivot entity, you must activate the pivot entity. To do so, access the pivot entity, and then select .
Relationship Between Entities
If you want to retrieve data from two or more entities in a single query, you must create a relationship (or a join) between them. When you create a relationship between entities, the two entities are joined by an inner join in SQL. The entity from which you create a relationship is called the source entity. The entity to which you create a relationship is called the target entity.
A single entity can be used both as a source entity and a target entity. A single entity can be used as a source entity in multiple relationships. A relationship can be bidirectional (that is, if there is a relationship from entity 1 to entity 2, you can also create a relationship from entity 2 to entity 1).
After you create a relationship, when you create a query, if you select the source entity in the Entity box, you can retrieve data from fields in both the source and target entities. If, however, you select the target entity, you can retrieve data only from the target entity.