Class EntityConfiguration<TFields>

The data storage configuration for a type of Entity. Contains information relating to IDs, cachable fields, field mappings, and types of cache and database adapter.

Type Parameters

  • TFields

Hierarchy

  • EntityConfiguration

Constructors

  • Type Parameters

    • TFields

    Parameters

    • __namedParameters: {
          cacheAdapterFlavor: string;
          cacheKeyVersion?: number;
          databaseAdapterFlavor: string;
          idField: keyof TFields;
          inboundEdges?: IEntityClass<any, any, any, any, any, any>[];
          schema: Record<keyof TFields, EntityFieldDefinition<any>>;
          tableName: string;
      }
      • cacheAdapterFlavor: string

        Cache system for this entity.

      • Optional cacheKeyVersion?: number

        Cache key version for this entity type. Should be bumped when a field is added to, removed from, or changed in this entity and the underlying database table.

      • databaseAdapterFlavor: string

        Backing database and transaction type for this entity.

      • idField: keyof TFields

        The field used to identify this entity. Must be a unique field in the table.

      • Optional inboundEdges?: IEntityClass<any, any, any, any, any, any>[]

        List of other entity types that reference this type in EntityFieldDefinition associations.

      • schema: Record<keyof TFields, EntityFieldDefinition<any>>

        Map from each entity field to an EntityFieldDefinition specifying information about the field.

      • tableName: string

        The name of the table where entities of this type are stored.

    Returns EntityConfiguration<TFields>

Properties

cacheAdapterFlavor: string
cacheKeyVersion: number
cacheableKeys: ReadonlySet<keyof TFields>
databaseAdapterFlavor: string
dbToEntityFieldsKeyMapping: ReadonlyMap<string, keyof TFields>
entityToDBFieldsKeyMapping: ReadonlyMap<keyof TFields, string>
idField: keyof TFields
inboundEdges: IEntityClass<any, any, any, any, any, any>[]
schema: ReadonlyMap<keyof TFields, EntityFieldDefinition<any>>
tableName: string

Methods

Generated using TypeDoc