Model Class @preview
A Model is a container for persisting a collection of related elements within an iModel.
See IModelDb.Models for how to query and manage the Models in an IModelDb.
See Creating models
Extends
Extended by
Methods
| Name | Description |  | 
| constructor(props: ModelProps, iModel: IModelDb): Model Protected |  |  | 
| collectReferenceIds(referenceIds: EntityReferenceSet): void Protected | Collect the Ids of this entity's references at this level of the class hierarchy. |  | 
| delete(): void | Delete this Model from the iModel. |  | 
| getJsonProperty(name: string): any |  |  | 
| getUserProperties(namespace: string): any | Get a set of JSON user properties by namespace |  | 
| insert(): string | Insert this Model in the iModel |  | 
| removeUserProperties(nameSpace: string): void | Remove a set of JSON user properties, specified by namespace, from this Element |  | 
| setJsonProperty(name: string, value: any): void |  |  | 
| setUserProperties(nameSpace: string, value: any): void | Change a set of user JSON properties of this Element by namespace. |  | 
| toJSON(): ModelProps | Obtain the JSON representation of this Entity. |  | 
| update(): void | Update this Model in the iModel. |  | 
| deserialize(props: DeserializeEntityArgs): ModelProps Static | Converts an ECSqlRow of an Entity to an EntityProps. |  | 
| onDelete(arg: OnModelIdArg): void Protected Static | Called before a Model is deleted. |  | 
| onDeleted(arg: OnModelIdArg): void Protected Static | Called after a Model was deleted. |  | 
| onDeletedElement(arg: OnElementInModelIdArg): void Protected Static | Called after an Element in an instance of a Model of this class has been deleted. |  | 
| onDeleteElement(_arg: OnElementInModelIdArg): void Protected Static | Called when an Element in an instance of a Model of this class is about to be deleted. |  | 
| onInsert(arg: OnModelPropsArg): void Protected Static | Called before a new Model is inserted. |  | 
| onInserted(_arg: OnModelIdArg): void Protected Static | Called after a new Model is inserted. |  | 
| onInsertedElement(arg: OnElementInModelIdArg): void Protected Static | Called after an Element has been inserted into an instance of a Model of this class. |  | 
| onInsertElement(_arg: OnElementInModelPropsArg): void Protected Static | Called before a prospective Element is to be inserted into an instance of a Model of this class. |  | 
| onUpdate(arg: OnModelPropsArg): void Protected Static | Called before a Model is updated. |  | 
| onUpdated(arg: OnModelIdArg): void Protected Static | Called after a Model is updated. |  | 
| onUpdatedElement(arg: OnElementInModelIdArg): void Protected Static | Called after an Element in an instance of a Model of this class has been updated. |  | 
| onUpdateElement(_arg: OnElementInModelPropsArg): void Protected Static | Called when an Element in an instance of a Model of this class is about to be updated. |  | 
| serialize(props: ModelProps, _iModel: IModelDb): ECSqlRow Static | Converts an EntityProps to an ECSqlRow. |  | 
Inherited methods
Properties
| Name | Type | Description |  | 
| _customHandledProps Protected Static Readonly | CustomHandledProperty[] | List of properties that are need to be custom handled during deserialization and serialization. |  | 
| className Accessor Static ReadOnly | string | The name of the BIS class associated with this class. |  | 
| isPrivate | boolean |  |  | 
| isTemplate | boolean |  |  | 
| jsonProperties Readonly | [key: string]: any |  |  | 
| modeledElement Readonly | RelatedElement |  |  | 
| name Readonly | string |  |  | 
| parentModel Readonly | string | undefined |  |  | 
Inherited properties
Defined in
Last Updated: 30 October, 2025