edmiCreateNestedScratchAggr

SdaiAggr edmiCreateNestedScratchAggr(SdaiAggr          parentAggr,
                                      SdaiInteger       index, 
                                      SdaiAggrType      aggrType, 
                                      SdaiInteger       lowerBound, 
                                      SdaiInteger       upperBound, 
                                      SdaiPrimitiveType valueType, 
                                      SdaiInstance      domainId); 


This operation creates a nested scratch aggregate instance in the scratch model, i.e., a scratch aggregate will not be written to the persistent EDMdatabase. The parent aggregate must be a scratch aggregate with element data type sdaiAGGR All EDMinterface access operations defined for persistent aggregates are applicable on scratch aggregates. The created aggregate will be inserted in the parent aggregate according to the aggregate type of the parent aggregate:

  1. ARRAY : Inserted as the element specified by the <index> argument
  2. LIST: Appended to the list
  3. BAG and SET: Added to the parent aggregate.

The scratch model is a volatile model that is deleted when the session is closed or the database is closed. The scratch model can hold instances of any instance types defined by any dictionary models in the EDMdatabase. Each open session has it own unique scratch model, hence the data in a scratch model cannot be shared between concurrent users of an EDMdatabase. The scratch model will implicitly be created and open for write access when the session is opened. A scratch aggregate can be deleted by the sdaiDeleteAggr operation. A nested scratch aggregate will implicitly be deleted when the parent scratch aggregate is deleted. All scratch aggregates are deleted when the open session is closed or when the database is closed.

Arguments


TypeNameComment
SdaiAggr

parentAggr

A numeric aggregateID that uniquely identifies a scratch aggregate in an EDMdatabase. The data type of the <parentAggr> must be sdaiAGGR.

SdaiInteger

index

The element index in the <parentAggr> that will hold the new created aggregate. This argument is only valid if the <parentAggr> is an ARRAY

SdaiAggrType

aggrType

Specify a valid aggregate type to be created. Legal types are sdaiARRAY, sdaiSET, sdaiBAG, and sdaiLIST.

SdaiInteger

lowerBound

Specify the lower index (starting number) to be used when creating the scratch aggregate. The <lowerBound> must be an integer number. Only valid for ARRAY.
Rule: lowerBound <= upperBound

SdaiInteger

upperBound

Specify the upper index to be used when creating the scratch aggregate. The <upperBound> must be an integer number. Only valid for ARRAY.
Rule: lowerBound <= upperBound

SdaiPrimitiveType

valueType

The data type, i.e. the primitive type of the elements in the created scratch aggregate. Legal data types are: sdaiINTEGER, sdaiREAL, sdaiSTRING, sdaiBOOLEAN, sdaiLOGICAL, sdaiBINARY, sdaiENUMERATION, sdaiAGGR, sdaiINSTANCE, sdaiADB .
For data type sdaiINSTANCE, the <domainId> argument can be used to specify the actual instance type.

SdaiInstance

domainId

Optional for specifying the domain of the scratch aggregate. When specified, the value is an instanceId of a meta-meta model instance or a meta model instance.  This argument can be zero. This argument can have two different inter-operations: 

  1. It is an aggregate domain, i.e., it is an instance of one of the following types: ARRAY_TYPE, BAG_TYPE, DEFINED_TYPE, LIST_TYPE, or SET_TYPE . The arguments <lowerBound>, <upperBound> and <valueType> have no effect, they are all overruled by the <domainId> argument.
  2. It is an SdaiEntity instance and the <valueType> argument is sdaiINSTANCE, the <domainId> argument specifies the actual instance type of the elements in the created scratch aggregate.

Return Value


TypeComment
SdaiAggr 

 

Options


  

 

Example


 

 SdaiAggr myScratchAggr, parentAggr;
 SdaiEntity personId;
 ...
 myScratchAggr = edmiCreateNestedScratchAggr(parentAggr,
 0, 
 sdaiLIST, 
 0, 
 0, 
 sdaiINSTANCE, 
 personId); 
 if (! myScratchAggr) {
 /* Error in operation */ 
 printf("\nError in edmiCreateNestedScratchAggr: %s\n", 
 edmiGetErrorText(sdaiErrorQuery())); 
 goto error; 
 }
 ...

 

See also

Filter by label

There are no items with the selected labels at this time.

Â