edmiRemoteGetAggrDescr
EdmiError edmiRemoteGetAggrDescr(SdaiServerContext serverContextId, SdaiAggr aggrId, SdaiAggrType *aggrType, SdaiInteger *lowerBound, SdaiInteger *upperBound, SdaiInstance *elementId, SdaiInstance *domainId, SdaiBoolean *optional, SdaiBoolean *unique, SdaiPrimitiveType *datatype, SdaiInteger *members, SdaiInvocationId *edmiInvocationId);
Returns the aggregate descriptor information of a specified aggregate in a remote EDMdatabase
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiAggr | aggrId | A numeric aggregateID that uniquely identifies the aggregate of interest in the remote EDMdatabase |
SdaiAggrType | aggrType | A variable that will receive the type of aggregate. Possible aggregate types are: sdaiLIST, sdaiARRAY, sdaiSET and sdaiBAG. |
SdaiInteger | lowerBound | A variable that will receive the declared lower bound of the aggregate. This value may be found in the attribute declaration in the underlying Express Schema of the edmModel that contains the aggregate. a : ARRAY [2:12] OF UNIQUE OPTIONAL STRING; |
SdaiInteger | upperBound | A variable that will receive the declared upper bound of the aggregate. This value may be found in the attribute declaration in the underlying Express Schema of the edmModel that contains the aggregate. a : ARRAY [2:12] OF UNIQUE OPTIONAL STRING; |
SdaiInstance | elementId | A variable that will receive a domainId that uniquely identifies the type of the aggregate elements in the remote EDMdatabase . This domainId identifies the declaration of the element type in the meta model that was initially stored in the database when the underlying Express Schema was compiled. |
SdaiInstance | domainId | A variable that will receive a domainId that uniquely identifies the aggregate within the remote EDMdatabase . This domainId identifies the aggregate declaration in the meta model that was initially stored in the database when the underlying Express Schema was compiled. |
SdaiBoolean | optional | A variable that will be set to sdaiTRUE if the aggregate elements are optional. Will be set sdaiFALSE if they are mandatory. This property may be found in the attribute declaration in the underlying Express Schema of the edmModel that contains the aggregate. |
SdaiBoolean | unique | A variable that will will be set to sdaiTRUE if the aggregate elements must be unique. Otherwise, it will be set to sdaiFALSE. This property may be found in the attribute declaration in the underlying Express Schema of the edmModel that contains the aggregate. |
SdaiPrimitiveType | datatype | A variable that will receive the primitive type of the aggregate elements. This property may be found in the attribute declaration in the underlying Express Schema of the edmModel that contains the aggregate. |
SdaiInteger | members | A variable that will receive the number of elements contained in the aggregate. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Options
Example
/* SCHEMA Employees ENTITY person; Name : STRING; Age : INTEGER; END_ENTITY; ENTITY Manning; DivisionStaff : ARRAY [0:4] OF SET OF person; END_ENTITY; END_SCHEMA; */ int i; EdmiError rstat; SdaiInteger nHits, nEmployees, index; SdaiServerContext myContext; SdaiInstance manningId; SdaiAggr parentAggrId, childAggrId; SdaiQueryResult qexRes; SdaiAggrType aggrType; SdaiInteger lowerBound, upperBound, members; SdaiInstance elementId, domainId; SdaiBoolean isOptional, isUnique; SdaiPrimitiveType dataType; /* Create Server Context */ rstat = edmiDefineServerContext("MyContext", "Johnny", "Supervisor", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &myContext); /* Get the manningId instance. It is assumed that there is only one instance of type Manning */ index = 0; nHits = 1; rstat = edmiRemoteSelectInstances(myContext, "AdminRepository", "Employees", "Manning", NULL, ONLY_INSTANCE_IDS, NULL, NULL, NULL, &index, &nHits, &qexRes, NULL, NULL, NULL, NULL); manningId = qexRes->instanceIds[0]; edmiFreeQueryResult(qexRes); /* Get the parent aggregate Id */ rstat = edmiRemoteGetAttrsBN(myContext, manningId, 0, 1, NULL, "DivisionStaff", sdaiAGGR, &parentAggrId); /* Get the parent aggregate descriptor */ rstat = edmiRemoteGetAggrDescr(myContext, parentAggrId, &aggrType, &lowerBound, &upperBound, &elementId, &domainId, &isOptional, &isUnique, &dataType, &members, NULL); /* Count the employees in all divisions */ for (i=lowerBound; i<=upperBound; i++) { rstat = edmiRemoteGetAggrElement(myContext, parentAggrId, 0, i, sdaiAGGR, &childAggrId, NULL); rstat = edmiRemoteGetMemberCount(myContext, childAggrId, 0, &nEmployees, NULL); printf("\nDivision %d: %d employees.", i, nEmployees); } . . .
See also
Filter by label
There are no items with the selected labels at this time.