Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for all data access object classes.

Type parameters

  • T

Hierarchy

  • Dao

Implemented by

Index

Methods

create

  • create(entity: T): Promise<T>
  • Creates a new record in database provided by given T entity.

    Parameters

    • entity: T

      A new T entity to create in database.

    Returns Promise<T>

    a T entity of the newly created record.

delete

  • delete(entity: T): Promise<T>
  • Deletes a record in database for given T entity.

    Parameters

    • entity: T

    Returns Promise<T>

    the deleted T entity, null if no record is found.

read

  • read(id: number): Promise<T>
  • Queries for an entity T with a given id.

    Parameters

    • id: number

      Unique identifier for a record to acquire.

    Returns Promise<T>

readAll

  • readAll(): Promise<T[]>
  • Queries for all records of entity T stored in database.

    Returns Promise<T[]>

    A collection of T model entities.

update

  • update(entity: T, params: Object): Promise<T>
  • Updates record attributes to values specified in params for a given T entity.

    Parameters

    • entity: T

      T entity to be updated.

    • params: Object

      JSON object with specified fields to be updated with new values.

    Returns Promise<T>

    the updated T entity, null if no record is found.

Generated using TypeDoc