Entity

    Interface IEntityLoadKey<TFields, TIDField, TSerializedLoadValue, TLoadValue>

    Interface responsible for defining how the key and corresponding load values behave in the data manager, cache adapter, and database adapter during entity field loading.

    interface IEntityLoadKey<
        TFields extends Record<string, any>,
        TIDField extends keyof TFields,
        TSerializedLoadValue,
        TLoadValue extends IEntityLoadValue<TSerializedLoadValue>,
    > {
        createCacheKeyPartsForLoadValue(
            entityConfiguration: EntityConfiguration<TFields, TIDField>,
            value: TLoadValue,
        ): readonly string[];
        deserializeLoadValue(value: TSerializedLoadValue): TLoadValue;
        getDatabaseColumns(
            entityConfiguration: EntityConfiguration<TFields, TIDField>,
        ): readonly string[];
        getDatabaseValues(value: TLoadValue): readonly any[];
        getDataManagerDataLoaderKey(): string;
        getLoadMethodType(): EntityLoadMethodType;
        getLoadValueForObject(object: Readonly<TFields>): null | TLoadValue;
        isCacheable(
            entityConfiguration: EntityConfiguration<TFields, TIDField>,
        ): boolean;
        serializeLoadValue(value: TLoadValue): TSerializedLoadValue;
        toString(): string;
        validateRuntimeLoadValuesForDataManagerDataLoader(
            values: readonly TLoadValue[],
            entityClassName: string,
        ): void;
        vendNewLoadValueMap<V>(): LoadValueMap<TSerializedLoadValue, TLoadValue, V>;
    }

    Type Parameters

    Implemented by

    Index

    Methods

    • Validate that that the load values adhere to the typescript types at runtime in order to prevent inadvertently passing invalid values to the data loader, cache adapter, or database adapter.

      Parameters

      • values: readonly TLoadValue[]

        The load values to validate.

      • entityClassName: string

        The name of the entity class to which the load values belong (for error message only).

      Returns void

    MMNEPVFCICPMFPCPTTAAATR