Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BasePopulationService<E>

Abstract generic class for implementing the various population services

Type parameters

Hierarchy

Index

Properties

Methods

Properties

Protected repository

repository: Repository<E>

The repository associated with the specific Entity

Methods

drop

  • drop(): Promise<void>
  • A generic drop function will simply call clear() (i.e. TRUNCATE) on the specific entity in the Service. However, the clear function does not support the CASCADE option, so this will need to be overwritten if there are relations that need to be cleared.

    Returns Promise<void>

Abstract populate

  • populate(data: Record<string, TestData[]>): Promise<E[]>
  • Each Population service will need to provide it's own populate function, since it would be almost impossible to handle testData, relations, etc in a generic way.

    Parameters

    • data: Record<string, TestData[]>

      A list of data to be entered into the database

    Returns Promise<E[]>

Generated using TypeDoc