This section describes standard mechanisms as to how to create, update or
remove records internally in the server. Implementation methods, New___
,
Modify___
and Remove___,
exist to handle data manipulation through records
in the server.
Data transport is done with the table record interface in the server. Please do not list all attributes as parameters!
The server uses records instead of the Attribute Strings. A server record is defined as:
This declaration means that all columns in the table exists in the record.
Public Records are a type of server record that only contains the public attributes of an entity.
The server should fetch data into records from views/tables, or call the
Get
method to fetch the public record. Each public attribute also
has a Get_<attribute> method for fetching just that attribute value.
The actions New___
, Modify___
and Remove___
are used for manipulating data. Note! These methods have triple underscores, and
they should not be mixed up with the client interaction methods having double
underscores.
A new record is created as follows:
Prepare_New___
method for setting entity default
values.New___
method.A record is modified as follows:
Get_Object_By_Keys___
method.Modify___
method with the updated record.A record is removed like this:
Remove___
method. When calling this method, only
the key attributes of the record are necessary to include.If you want to create, modify or remove records in another entity, the target
entity must expose a public method to do the operation. For
client interactions there are generic interfaces for creating, modifying and
removing data but no corresponding methods exist for server to server calls, and
there should not be such generic
interfaces either. Do not expose the server methods New___
, Modify___
and Remove___
as public New, Modify or Remove methods. Instead you should
create a more specific interface called something similar to what you want to
do. For example, a method called Create_Order_Line could be implemented in an entity
called OrderLine. This
method should then call the server method New___
in the OrderLine entity.