MetaModelInfo Class
The IMetaModel interface is used to create, read, modify or delete a CMetaAIM class. See “CMetaAIM Class” for more detailed information.
Property |
Type |
Description |
Common Properties |
|
|
ClassList |
IMetaClassInfoList |
Return the MetaClassInfo objects for this model (read only). |
RelationshipList |
IMetaRelationshipInfoList |
The list of all relationship descriptions associated with this class (read only). |
Common Properties
get_RelationshipList
Purpose:
Gets the list of relationships in the model (read only).
Requirements:
Must be proceeded by a Read(VARIANT_TRUE) call for the class, else the list will be empty.
Syntax:
HRESULT get_RelationshipList(
[out, retval] IMetaRelationshipInfoList * *pVal);
get_ClassList
Purpose:
Gets the list of classes in the model (read only).
Requirements:
Must be proceeded by a Read(VARIANT_TRUE) call for the class, else the list will be empty.
Syntax:
HRESULT get_ClassList(
[out, retval] IMetaClassInfoList * *pVal);
Delete
Purpose:
Use this method to delete the model description object from the MDS repository.
Requirements:
The object identifier must be set before calling the Delete method.
Syntax:
HRESULT Delete();
Read
Purpose:
Use this method to read the model description object from the MDS repository.
Description:
The Detail argument indicates whether to read the list of the classes and relationships for this particular model. If the Detail is "true", the model's classes and relationships are read and are available through the get_ClassList and get_RelationshipList properties. Otherwise, if the Detail is "false", the classes and relationships for the model are not read and the two lists will be empty. If not specified, the value is taken as "false".
Requirements:
The object identifier must be set before calling the Read method.
Syntax:
HRESULT Read(
[in, optional] VARIANT_BOOL Detail);
Create
Purpose:
Use this method to write the model description object to the MDS repository.
Syntax:
HRESULT Create();
Update
Purpose:
Use this method to modify certain attributes of the MetaRelationshipInfo object after it has been created. See the Microsoft Visual C++ Programmer’s Guide for attributes that can be changed.
Syntax:
HRESULT Update();
AddClass
Purpose:
Use this method to add a class description to the model. The model must have already been created in the MDS repository.
Requirements:
The model must have already been created in the MDS repository.
Syntax:
HRESULT AddClass(
[in] IMetaClassInfo *lpClassInfo);
AddRelationship
Purpose:
Use this method to add a relationship description to the model. The model must have already been created in the MDS repository.
Requirements:
The model must have already been created in the MDS repository.
Syntax:
HRESULT AddRelationship(
[in] IMetaRelationshipInfo *lpRelationshipInfo);
GetVersionSupport
Purpose:
Returns the current setting for the VersioningSupport property of a MetaModelInfo object. For an existing AIM, this value is only meaningful after calling Read.
Description:
The VersioningSupport property has three possible values:
Syntax:
HRESULT GetVersionSupport(
[out, retval] MetaVersionSupportLevel* level);
SetVersioning
Purpose:
Allows an application to dynamically enable or disable data versioning for a metamodel.
Description:
If bVersioningAllowed is false, versioning will be disabled for the metamodel. If bVersioningAllowed is true and the repository allows versioning, then versioning will be enabled for the metamodel, else versioning will be left disabled for the metamodel. bDeleteVersions indicates whether existing historical versions for objects in the AIM's classes should be deleted or retained; however, this parameter is ignored unless versioning is already off for this AIM or is being turned off by this call.
A Read call does not does not need to be done before this call, but in that case, either the model ID or model GUID must be set.
Syntax:
HRESULT SetVersioning(
[in] VARIANT_BOOL bVersioningAllowed,
[in, optional] VARIANT_BOOL bDeleteVersions);