Options
All
  • Public
  • Public/Protected
  • All
Menu

Data access object (Dao) class for Item model entity

see

Dao

Hierarchy

  • ItemDao

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • Create an Item data access object.

    Returns ItemDao

Properties

Private _pool

_pool: Pool

Methods

create

  • Creates a new record in database provided by given Item entity.

    Parameters

    • item: Item

      A new Item entity to create in database.

    Returns Promise<Item>

    an Item entity of the newly created record.

delete

  • Deletes item record in database for given Item entity, record is acquired by id field in given Item entity.

    Parameters

    • item: Item

      Item entity to be deleted from database.

    Returns Promise<Item>

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

read

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

    Parameters

    • id: number

      Unique identifier for an item to acquire.

    Returns Promise<Item>

    a Item model entity for resultant record, null if none found.

readAll

  • readAll(): Promise<Item[]>
  • Queries for all items stored in database.

    Returns Promise<Item[]>

    A collection of Item model entities.

update

  • Updates record attributes to values specified in params, record is acquired by id field in given Item entity.

    Parameters

    • item: Item

      Item entity to be updated.

    • params: ItemParams

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

    Returns Promise<Item>

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

Generated using TypeDoc