-
Notifications
You must be signed in to change notification settings - Fork 4
Define Entity
JOR starts with defining entities. An entity can be a person, an order, a material, or any objects that you want to store and manage in your information system. Here, we use 'person' entity to go through the tutorial.
Access the modeling tool: http://localhost:3000/model, under the tab 'Entity', you can find the entity 'person'. An entity is composed by attributes and roles. The person entity has the attribute 'GENDER',
if the gender is male, then role 'husband' is enabled, and if the gender is female, the role 'wife' is enabled.

When the 'TYPE' of a person is 'employee', he has the role 'employee'.
Under the tab 'Role', you can find the definition of role 'employee'.
A Role is used to group relevant Relations together. Like employee has Relations: 'r_address', 'r_email', and 'r_employee'.

A Relation corresponds to a DB table which represents a collection of attributes.
You group attributes into a Relation mainly because the attributes are always processed together.
Hopefully, the performance and security are considered meanwhile.
For example, if you want only certain attributes are exposed to certain users,
you can set authorization control at Relation level.
Besides, you can define associations to other Relations to involve more associated attributes.
Check the definition of Relation 'r_employee' under the tab 'Relation':

Entities can have relationships with others. Each relationship is performed by certain roles.
For example, relationship 'rs_marriage' is performed by the 2 roles: 'husband' and 'wife'.
Once the 2 roles are respectively assigned to 2 people, they can then have the marriage relationship.
A relationship can also have attributes. The marriage has the attribute 'REG_PLACE' to indicate the registration place. If a relationship is time dependent, it also has attributes 'VALID_FROM' and 'VALID_TO'.
You can find the definition of 'rs_marriage' under the tab 'Relationship':
