Patent ID: 8762421

Claim:
A method for accessing entities of a data access layer, the data access layer following an entity-relationship model in which data are depicted in term of the entities and relationships between them, the entities being provided with a CRUD (Create, Read, Update, Delete) interface, which comprises the steps of: defining a meta-entity, hereinafter referred to as a virtual entity, resulting as a composition of parts of at least one entity; describing the virtual entity, via a virtual entity descriptor, as a hierarchical structure in which the entities are connected in a parent-child structure via a link, and in the virtual entity descriptor, specifying which properties are taken from each entity to form partial entities of the virtual entity; providing CRUD (Create, Read, Update, Delete) methods for accessing the entities composing the virtual entity, wherein the CRUD methods include a read method and at least one write method; providing a CRUD (Create, Read, Update, Delete) interface on the virtual entity; and at run time, accessing the virtual entity via the CRUD interface by calling the write method of the CRUD methods to write to the entities composing the virtual entity; wherein the write method is an edit method in which: a check is performed on the hierarchical structure of the virtual entity in order to decide a processing order of each of its partial entities: if the child entity is linked to a father entity with a straight link, the child entity is processed before the father entity; if the child entity is linked to the to the father entity with a back link, the child entity is processed after the father entity; wherein a processing of each partial entity contains the following sub-steps: the partial entity is examined to check whether it is to be modified or not; if it is to be modified: an up-to-date full entity instance is retrieved from a database; a check is performed on a hierarchical position of a current partial entity: if the current partial entity is a root entity or is straight-linked to its father, it is retrieved either through one of its lookup identifiers if marked as looked-up or through one of its unique keys; if it is successfully retrieved, it is updated with new values on the database, unless it is a lookup entity which is not marked as “updatable”; otherwise, if the current partial entity is back-linked to its father: if the current partial entity is not retrievable through a unique key, an entity instance with the new values is created; otherwise if all the new values of its accessible properties are null, a full entity instance is removed from the database, otherwise, if at least one new value of an accessible property is not null, the current partial entity is updated with the new values.