Skip to content
VinceZK edited this page Apr 8, 2020 · 2 revisions

In JOR, entity is the endpoint. Data is accessed and manipulated on entities. All other artifacts are finally composed to form entities. An entity can contain its own attributes, which are called entity attributes. From this point of view, an entity is also a relation.

An entity gains other attributes from the roles that are assigned to it. Besides, relationships are also derived from the roles, which allow the entity to connect with other entities. This gives JOR the ability to build an information system, rather than just a backend server.

Create Entity

In the modeling tool, go to the 'Entity' tab. The left list shows the 10 latest entities in the system. You can run a fuzzy search which filters in names and descriptions. Click the '+' button on the top right, you can create a new entity.

You must give a unique name, and optionally, some description.

Attribute

You add entity attributes just like adding attributes in Relation. The only difference is that there is no primary key(PK) or auto increment(AI). This is because each entity instance has an internal instance GUID as the primary key.

Entity attributes are role-independent. On the contrary, roles depend on entity attributes. For example, role husband depends on the GENDER attribute, only if the gender is male, can the husband role be enabled.

Role

Roles are assigned to an entity to give attributes and relationships to the entity. There is no limitation on how many roles or what kinds of roles should be assigned to an entity. However, you can use an entity attribute to conditionally enable or disable a role. The condition is formulated by checking whether the instance value is contained in the conditional values which can be an array separated by commas. If no condition is given to a role, it is always enabled.

Change Entity

You can add or delete attributes just like in Relation. If the attribute deleted is used in role conditions, the conditions are also removed. Which means the corresponding roles will be always enabled.

You can also add or remove roles. Inconsistencies could happen if a role is added with mandatory relations, or a role is deleted with existing relationships. You have to manually correct these.