Version 3 (modified by 15 years ago) (diff) | ,
---|
Backtracking
The issue of Backtracking considers the need of save every version of a modified entity and makes possible the reverse of an action. Hereby will be described a perspective to solve this problematic.
The EntityBuilder? has the task of building an entity. There are two types of Entities:
- Original Entity: the current and valid version of an entity. It could be recognized by the attribute systemStatus, which has the value “original”.
- Copy Entity: always when an entity is modified, the previous version will be saved with the systemStatus: “copy” and the new version is saved with the corresponding time stamp.
The connection from entity to attribute and from entity to relation is done respectively by the table entity_attribute and entity_relation using only the identification(id) of each object.
In the current version of ismi is needing the following join to build an entity:
select * from entity, attribute, entity_attribute where entity.id = X && attribute.id= Y && entity_attribute.entityId = X && entity_attribute.attributeId= Y,
Where X, Y are Numbers.
The Builder class requires a modification to difference between the current entity and its previous version.
The following query will be used to build the current entity:
select * from entity, attribute, entity_attribute where entity.id = X && attribute.id= Y && entity_attribute.entityId = X && entity_attribute.attributeId= Y && entity.systemStatus = “original” && attribute.systemStatus = original“.