Member Junction
    Preparing search index...

    Interface IEntityDataProvider

    Interface for entity data providers. Defines core CRUD operations and record change tracking. Implementations handle database-specific operations for entity persistence.

    interface IEntityDataProvider {
        BeginISATransaction?(): Promise<unknown>;
        CommitISATransaction?(txn: unknown): Promise<void>;
        Config(configData: ProviderConfigDataBase): Promise<boolean>;
        Delete(
            entity: BaseEntity,
            options: EntityDeleteOptions,
            user: UserInfo,
        ): Promise<boolean>;
        FindISAChildEntities?(
            entityInfo: EntityInfo,
            recordPKValue: string,
            contextUser?: UserInfo,
        ): Promise<{ ChildEntityName: string }[]>;
        FindISAChildEntity?(
            entityInfo: EntityInfo,
            recordPKValue: string,
            contextUser?: UserInfo,
        ): Promise<{ ChildEntityName: string }>;
        GetRecordChanges(
            entityName: string,
            CompositeKey: CompositeKey,
        ): Promise<RecordChange[]>;
        Load(
            entity: BaseEntity,
            CompositeKey: CompositeKey,
            EntityRelationshipsToLoad: string[],
            user: UserInfo,
        ): Promise<{}>;
        RollbackISATransaction?(txn: unknown): Promise<void>;
        Save(
            entity: BaseEntity,
            user: UserInfo,
            options: EntitySaveOptions,
        ): Promise<{}>;
    }

    Implemented by

    Index

    Methods

    • Begin an independent provider-level transaction for IS-A chain orchestration. Returns a provider-specific transaction object (e.g., sql.Transaction for SQLServer). Separate from the provider's internal transaction management (TransactionGroup system). Optional — client-side providers (GraphQL) do not implement this.

      Returns Promise<unknown>

    • Commit an IS-A chain transaction.

      Parameters

      • txn: unknown

        The transaction object returned from BeginISATransaction()

      Returns Promise<void>

    • Discovers ALL IS-A child entities that have records with the given primary key. Used for overlapping subtype parents (AllowMultipleSubtypes = true) where multiple children can coexist. Same UNION ALL query as FindISAChildEntity, but returns all matches.

      Parameters

      • entityInfo: EntityInfo

        The parent entity's EntityInfo (to find its child entity types)

      • recordPKValue: string

        The primary key value to search for in child tables

      • OptionalcontextUser: UserInfo

        Optional context user for server-side operations

      Returns Promise<{ ChildEntityName: string }[]>

      Array of child entity names found (empty if none)

    • Discovers which IS-A child entity, if any, has a record with the given primary key. Used by BaseEntity.InitializeChildEntity() after loading a record to find the most-derived child type. Implementations should execute a single UNION ALL query across all child entity tables for efficiency.

      Parameters

      • entityInfo: EntityInfo

        The parent entity's EntityInfo (to find its child entity types)

      • recordPKValue: string

        The primary key value to search for in child tables

      • OptionalcontextUser: UserInfo

        Optional context user for server-side operations

      Returns Promise<{ ChildEntityName: string }>

      The child entity name if found, or null if no child record exists

    • Rollback an IS-A chain transaction.

      Parameters

      • txn: unknown

        The transaction object returned from BeginISATransaction()

      Returns Promise<void>