AbstractDao
On this page
- AbstractDao ⇐
Abstract
- AbstractDao()
- init() ⇒
Promise
- create(obj) ⇒
Promise.<AbstractEntity>
- findById(id) ⇒
Promise.<AbstractEntity>
- findAll() ⇒
Promise.<Array.<AbstractEntity>>
- findWhere(columnName, value, operator, [options]) ⇒
Array.<AbstractEntity>
- update(obj) ⇒
Promise.<AbstractEntity>
- delete(obj) ⇒
Promise.<AbstractEntity>
- countAll() ⇒
Promise.<number>
- _buildEntity(data) ⇒
AbstractEntity
- _generateUUID() ⇒
string
- _createTable() ⇒
Promise.<Object>
- _create(obj) ⇒
Promise.<Object>
- _findAll() ⇒
Promise.<Array.<Object>>
- _findWhere(columnName, value, operator) ⇒
Promise.<Object>
- _update(obj) ⇒
Promise.<Object>
- _delete(obj) ⇒
Promise.<Object>
- _dropTable() ⇒
Promise.<Object>
- _countAll() ⇒
Promise.<number>
- OPERATOR_EQUAL :
string
- OPERATOR_LIKE :
string
AbstractDao ⇐ Abstract
Kind: global class
Extends: Abstract
Dao:
Properties
Name | Type | Description |
---|---|---|
ENTITY | AbstractEntity | Entity property is mandatory for access to BDD... |
ENTITY | AbstractEntity | Mandatory Entity reference |
- AbstractDao ⇐
Abstract
- new AbstractDao()
- instance
- .init() ⇒
Promise
- .create(obj) ⇒
Promise.<AbstractEntity>
- .findById(id) ⇒
Promise.<AbstractEntity>
- .findAll() ⇒
Promise.<Array.<AbstractEntity>>
- .findWhere(columnName, value, operator, [options]) ⇒
Array.<AbstractEntity>
- .update(obj) ⇒
Promise.<AbstractEntity>
- .delete(obj) ⇒
Promise.<AbstractEntity>
- .countAll() ⇒
Promise.<number>
- ._buildEntity(data) ⇒
AbstractEntity
- ._generateUUID() ⇒
string
- ._createTable() ⇒
Promise.<Object>
- ._create(obj) ⇒
Promise.<Object>
- ._findAll() ⇒
Promise.<Array.<Object>>
- ._findWhere(columnName, value, operator) ⇒
Promise.<Object>
- ._update(obj) ⇒
Promise.<Object>
- ._delete(obj) ⇒
Promise.<Object>
- ._dropTable() ⇒
Promise.<Object>
- ._countAll() ⇒
Promise.<number>
- .init() ⇒
- static
- .OPERATOR_EQUAL :
string
- .OPERATOR_LIKE :
string
- .OPERATOR_EQUAL :
AbstractDao()
Data Access Object Pattern pattern is used to separate low level data accessing API or operations from high level business services.
init() ⇒ Promise
Enable BDD access 1- create table (if not exist) 2- insert data (if mocked usage)
Kind: instance method of AbstractDao
create(obj) ⇒ Promise.<AbstractEntity>
Add a new entity
Kind: instance method of AbstractDao
Param | Type | Description |
---|---|---|
obj | AbstractEntity | an entity object inherit from AbstractEntity |
findById(id) ⇒ Promise.<AbstractEntity>
Get an entity by it’s id
Kind: instance method of AbstractDao
Param | Type | Description |
---|---|---|
id | string | number | id of entity |
findAll() ⇒ Promise.<Array.<AbstractEntity>>
Get all entities
Kind: instance method of AbstractDao
findWhere(columnName, value, operator, [options]) ⇒ Array.<AbstractEntity>
Get an entity with condition
Kind: instance method of AbstractDao
Param | Type | Description |
---|---|---|
columnName | string | name of column condition |
value | string | number | value of condition |
operator | string | condition operator |
[options] | Object |
update(obj) ⇒ Promise.<AbstractEntity>
Update an entity
Kind: instance method of AbstractDao
Param | Type | Description |
---|---|---|
obj | AbstractEntity | an entity object inherit from AbstractEntity |
delete(obj) ⇒ Promise.<AbstractEntity>
Delete an entity
Kind: instance method of AbstractDao
Param | Type | Description |
---|---|---|
obj | AbstractEntity | an entity object inherit from AbstractEntity |
countAll() ⇒ Promise.<number>
Count all entity in table
Kind: instance method of AbstractDao
_buildEntity(data) ⇒ AbstractEntity
Build an Entity
Kind: instance method of AbstractDao
Access: protected
Param | Type |
---|---|
data | Object |
_generateUUID() ⇒ string
Generate a UUID
Kind: instance method of AbstractDao
Access: protected
_createTable() ⇒ Promise.<Object>
Kind: instance abstract method of AbstractDao
Access: protected
_create(obj) ⇒ Promise.<Object>
Kind: instance abstract method of AbstractDao
Access: protected
Param | Type |
---|---|
obj | Object |
_findAll() ⇒ Promise.<Array.<Object>>
Kind: instance abstract method of AbstractDao
Access: protected
_findWhere(columnName, value, operator) ⇒ Promise.<Object>
Kind: instance abstract method of AbstractDao
Access: protected
Param | Type |
---|---|
columnName | string |
value | * |
operator | string |
_update(obj) ⇒ Promise.<Object>
Kind: instance abstract method of AbstractDao
Access: protected
Param | Type |
---|---|
obj | Object |
_delete(obj) ⇒ Promise.<Object>
Kind: instance abstract method of AbstractDao
Access: protected
Param | Type |
---|---|
obj | Object |
_dropTable() ⇒ Promise.<Object>
Kind: instance abstract method of AbstractDao
Access: protected
_countAll() ⇒ Promise.<number>
Kind: instance abstract method of AbstractDao
Access: protected
OPERATOR_EQUAL : string
Kind: static constant of AbstractDao
OPERATOR_LIKE : string
Kind: static constant of AbstractDao