sdaiGetEntityExtentBN
Returns a numeric aggregateID that uniquely identifies the aggregate that holds all instances of one particular type in a model. This aggregate is connected to the attribute named instances in an entity extent instance belonging to a specified model in the EDMdatabase. There is one entity extent instance for each possible instance type in a model. The possible instance types in a model are all the entity definition instances in the related dictionary model that are not defined as abstract entity.
The actual aggregate connected to the instances attribute of an entity extent instance contains all instances of one particular instance type in one model. The attribute named definition in an entity extent instance defines the instance type of the instances the actual aggregate holds.
The actual model must be open before this operation can be successfully performed.
Related function: sdaiGetEntityExtent
Header:
#include "sdai.h"
Prototype:
SdaiAggr sdaiGetEntityExtentBN(SdaiModel model,
SdaiString entityName);
Arguments:
model |
A numeric modelID that uniquely identifies the actual model in the EDMdatabase. |
entityName |
The name of the actual entity, i.e. the instance type. Entity names are case insensitive. An entity name is unique within one model, i.e. within on EXPRESS schema. |
Returns:
A numeric aggregateID that uniquely identifies the aggregate that contains all instances of the specified type in the actual model.
aggregateID != 0 : operation successfully performed.
aggregateID = 0 : operation failed, use sdaiErrorQuery function to get error reason.
Example:
SdaiModel model;
SdaiAggr instancesId;
...
instancesId = sdaiGetEntityExtentBN (model, "Product");
if (! instancesId) {
/* Error in operation */
printf("\nError: %s in sdaiGetEntityExtentBN \n",
edmiGetErrorText(sdaiErrorQuery()));
goto error;
}
printf("\nNumber of Product instances in model: %ld",
sdaiGetMemberCount(instancesId));
. . .