edmiCreateModelBN

SdaiModel edmiCreateModelBN(SdaiRepository repository,
                             SdaiString     modelName, 
                             SdaiString     schemaName, 
                             SdaiString     options); 


Creates a new model in the specified repository in the EDMdatabase. A model is a logical container for entity instances defined by one Express schema. This schema will be the underlying schema of the new model and this particular schema must exist as a dictionary model in the EDMdatabase before this function can be successfully performed. Only data models can be created by this function. Any number of models of the same Express schema can exist in an EDMdatabase. This operation is similar to the sdaiCreateModelBN operation except that this operation can specify additional attributes for the created model. These model attributes can influence the system performance. The new model will be closed after creation, hence one of the functions sdaiOpenModel or sdaiOpenModelBN must be performed on the model before any access to it is permitted. A numeric modelID that uniquely identifies the created model in the EDMdatabase is returned. This modelID should be used in subsequent EDMinterface operations to identify this particular model. The model name qualified with the related repository name will also uniquely identify a model in an EDMdatabase. The executing EDMuser will be the owner of the new model and the current EDMgroup account of the executing EDMuser will be the owner group of the model. The owner and owner group of a model is relevant for access rights to the model in subsequent sdaiOpenModel and sdaiOpenModelBN operations. The model protection will be set according to the default model protection of the executing EDMuser. The repository that will hold the new model must be open before this function can be successfully performed.

Arguments


TypeNameComment
SdaiRepository

repository

A numeric repositoryID that uniquely identifies the repository in the EDMdatabase that will hold the new model. This repository must be open.
The repositoryID is returned by the sdaiOpenRepository and sdaiOpenRepositoryBN functions.

SdaiString

modelName

Specify the name of the new model. A model name must start with a letter and the rest of the model name can optionally be any mix of any alphanumeric character and the underscore character. Model names are case sensitive. A model name must be unique within the repository that holds the model.

SdaiString

schemaName

The name of an EXPRESS schema in the EDMdatabase that will be the underlying schema of the new model. Schema names are case insensitive. This schema defines all possible instance types that can be created in the actual model. This particular EXSPRESS schema must exist as a dictionary model in the EDMdatabase before this operation can be successfully performed.

SdaiString

options

Specifies the current options, i.e., the model attributes. The <options> value should be defined as a bitwise OR between the options to enable. All the option names are defined in the header file sdai.h . Default options are enabled when the value of <options> is set to zero.

Return Value


TypeComment
SdaiModel 
 

 

Options


  

OptionComment

M_USER_CONTROLLED_INVERSE

No automatic update and maintenance of INVERSE attributes in the actual model

M_INSTANCE_REFERENCES

The system will keep track of all references to an instance in the model.

M_DELETE_INSTANCE_REFS_ON_DELETE

All references to an instance will implicitly be deleted when the instance is deleted.

M_INSTANCE_REFS_MUST_BE_DELETED

An instance cannot be deleted as long as the instance is referenced by another instance.

M_PACKED_MODEL

No garbage collection for model when data is freed on data deletion or data change operation.

USE_DEFAULT_OPTIONS

 

M_INSTANCES_HASH_TABLE

 

INSTANCES_HASH_TABLE

same as M_INSTANCES_HASH_TABLE, used to mark that modelInstanceHashTable is defined by edmiHashModelInstances function

M_IGNORE_PERSISTENT_ATTR_HASH_TABLE

 

IGNORE_PERSISTENT_ATTR_HASH_TABLE

 M_IGNORE_PERSISTENT_ATTR_HASH_TABLE

PERSISTENT_INSTANCES_HASH_TABLE

creates a  EDMpersistentInstancesHashTable

CHAR_ENCODING_UTF_8
 

 

CHAR_ENCODING_UTF_16

 

CHAR_ENCODING_ISO_10646_UCS_2

 

CHAR_ENCODING_ISO_10646_UCS_4

 

CHAR_ENCODING_ISO_LATIN_1

 

CHAR_ENCODING_ISO_LATIN_2

 

CHAR_ENCODING_ISO_8859_3

 

CHAR_ENCODING_ISO_8859_4

 

CHAR_ENCODING_ISO_8859_5

 

CHAR_ENCODING_ISO_8859_6

 

CHAR_ENCODING_ISO_8859_7

 

CHAR_ENCODING_ISO_8859_8

 

CHAR_ENCODING_ISO_8859_9

 

CHAR_ENCODING_ISO_2022_JP

 

CHAR_ENCODING_SHIFT_JIS

 

CHAR_ENCODING_EUC_JP

 

 

Example


 

 SdaiModel model;
 SdaiRepository repository;
 ...
 model = edmiCreateModelBN (repository,
 "MyNewModel", 
 "Pdm_Schema", 
 0); 
 if (! model) {
 /* Error in operation */ 
 printf("\nError in edmiCreateModelBN: %s\n", 
 edmiGetErrorText(sdaiErrorQuery())); 
 goto error; 
 }
 ...

 

See also

Filter by label

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

Â