WYRDTEK Home Features Reference Downloads About



int es_mba_new( struct es_mbd *def, struct es_mba **res, char *ebuf, int ebufsize );


es_mbd *def Database definition.
struct es_mba **res Assigned result. Passed by reference.
char *ebuf Error message buffer. Populated by es_mba_new on error.
int ebufsize Size of error message buffer ebuf in bytes.

Return Codes

ES_ERROR_NONE Success. No errors.
ES_ERROR_INVALIDSCHEMA Database definition def does not meet the required criteria. See below.


Construct a new aggregator with respect to the database definition def.

In order for a database definition to be valid it must obey the following rule: If more than one class share a common field name, the meaning and type of that field name is assumed and required to be the same. For example, if the definition def contained two classes both of which had a field named "ProductId", then "ProductId" is required to have the same type declaration in both classes.

The reason for this is because if the aggregator is required to join two disparate classes together it needs to be able to identify the key/foreign-key pair of fields. If the foreign key always has the same field name as the key it makes the job easy.

Failure to meet this criteria causes es_mba_new() to fail with a ES_ERROR_INVALIDSCHEMA error code and the name of the offending database field supplied in the ebuf parameter.

[Back To Reference] [Back To Reference/es_mba]