The class definition, that should be implemented in any class that maps an entity from the database, are:
METHODS:
- CONSTRUCTOR: Public - Creates the entity, without any relation to database;
- SAVE: Public - Will save the entity in database, insert or update;
- EXISTS: Public - Check if the entity exists at database level.;
- INITIALIZE: Private - Selects data from database if needed.
- *GETTERS AND SETTERS: This is a set of methods that should be implemented for every field from the entity. The methods are always GET<entity_fields> AND SET<entity_fields>, where <entity_fields> should be replaced;
ATTRIBUTES:
- KEY: Structure(TYKEY) - <entity_pks>: The primary keys of the entity;
- FOUND: Private - ABAP_BOOL - Return if the entity was found at database;
- FIELDBUFCTRL: Structure (tyFields) - SQLEXECUTED TYPE ABAP_BOOL, <entity_fields> TYPE ABAP_BOOL - Controls if the SQL was executed
- *ENTITY ATTR: Set of attributes that maps each field from entity.
This class definition creates a POCO. This is the basic for a class for THE PROJECT