Entity Class @preview
Represents one of the fundamental building block in an IModelDb: as an Element, Model, or Relationship. Every subclass of Entity represents one BIS ECClass. An Entity is typically instantiated from an EntityProps and can be converted back to this representation via Entity.toJSON.
Extended by
Methods
| Name | Description | |
|---|---|---|
| constructor(props: EntityProps, iModel: IModelDb): Entity Protected | ||
| collectReferenceIds(_referenceIds: EntityReferenceSet): void Protected | Collect the Ids of this entity's references at this level of the class hierarchy. | |
| forEach(func: PropertyHandler, includeCustom: boolean = true): void | Call a function for each property of this Entity. | |
| forEachProperty(func: PropertyCallback, includeCustom: boolean = true): void | Call a function for each property of this Entity. | Deprecated |
| getMetaData(): Promise<EntityClass | RelationshipClass> | Query metadata for this entity class from the iModel's schema. | |
| getReferenceIds(): EntityReferenceSet | Get the set of this entity's entity references, EntityReferenceSet. | |
| toJSON(): EntityProps | Obtain the JSON representation of this Entity. | |
| deserialize(props: DeserializeEntityArgs): EntityProps Static | Converts an ECSqlRow of an Entity to an EntityProps. | |
| is(otherClass: Entity): boolean Static | return whether this Entity class is a subclass of another Entity class | |
| serialize(props: EntityProps, _iModel: IModelDb): ECSqlRow Static | Converts an EntityProps to an ECSqlRow. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| _customHandledProps Protected Static Readonly | CustomHandledProperty[] | List of properties that are need to be custom handled during deserialization and serialization. | |
| _metadata Protected | EntityClass | RelationshipClass | Cached Metadata for the ECClass | |
| classFullName Accessor ReadOnly | string | Get the full BIS class name of this Entity in the form "schema:class". | |
| classFullName Accessor Static ReadOnly | string | Get the full BIS class name of this Entity in the form "schema:class" | |
| className Accessor ReadOnly | string | The name of the BIS class associated with this class. | |
| className Accessor Static ReadOnly | string | The name of the BIS class associated with this class. | |
| id | string | The Id of this Entity. | |
| iModel | IModelDb | The IModelDb that contains this Entity | |
| isInstanceOfEntity Readonly | "true" | An immutable property used to discriminate between Entity and EntityProps, used to inform the TypeScript compiler that these two types | |
| schema Static | Schema | The Schema that defines this class. | |
| schemaItemKey Accessor Static ReadOnly | SchemaItemKey | Serves as a unique identifier for this class. | |
| schemaItemKey Accessor ReadOnly | SchemaItemKey | Get the item key used by the ecschema-metadata package to identify this entity class | |
| schemaName Accessor ReadOnly | string | The name of the BIS Schema that defines this class |
Defined in
- core/backend/src/Entity.ts Line 51
Last Updated: 28 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.