Modeling Services > Dynamic Modeling Services > How to Use Dynamic Objects > Maintaining Inverse Relations
 
Maintaining Inverse Relations
If declared as dynamic in the server model interpreter, inverse relations are automatically maintained by the member function IlsDynObject::setContext.
You are responsible for maintaining static inverse relations. If the direct relation is dynamic and the target type is static, you have to override the setContext and unsetContext member functions to maintain your inverse relations and call the corresponding member function in the base class.
Note that when a dynamic relation is created, its relation identifier is a pointer to the associated instance of IlsRelationDef. You have to cast the relation identifier to this type to retrieve it:
IlsRelationDef* directRel = (IlsRelationDef*)id;

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.