Template classes
Last updated
Last updated
The template offers convenience operations to create, update, delete, query and provides a mapping between your domain objects and Diana API. The templates classes have the goal to persist an Entity Model through Diana API. It has three components:
Converter: That converts the Entity to a communication level API.
EntityManager: The EntityManager from Diana.
Workflow: That defines the workflow when either save or update an entity These events are useful when you, eg., want to validate data before be saved. See the following picture:
The default workflow has four events:
firePreEntity: The Object received from Artemis.
firePreEntityDataBaseType: Just like the previous event, however, to a specific database, in other words, each database has a particular event.
firePreAPI: The object converted to a communication layer.
firePostAPI: The entity connection as a response from the database.
firePostEntity: The entity model from the API low level from the firePostAPI
.
firePostEntityDataBaseType: Just like the previous event, however, to a specific database, in other words, each database has a particular event.