Class: zCrudService

zCrudService()

Service that contains the functions related to the crud (create, read, update, delete).

Constructor

new zCrudService()

Author:
Source:

Classes

zCrudService

Members

dbService

Stores instance zDatabaseService.
Author:
Source:

tService

Stores instance zTranslateService.
Author:
Source:

Methods

(static) destroyInstance()

Function used to destroy instance of zCrudService.
Author:
Source:

(static) getInstance()

Function used to get instance of zCrudService
Author:
Source:
Returns:
zCrudService

create(obj, tableName)

Function used to insert values in a given table.
Parameters:
Name Type Description
obj any | Array.<any> Values to Insert.
tableName string Table Name contains in database.
Author:
Source:
Returns:
Observable | contains the values entered with the id

delete(id, fieldName, tableName, isLogical)

Function used to delete values in a given table.
Parameters:
Name Type Description
id number Delete id.
fieldName string Field Name which is primary key
tableName string Table Name contains in database.
isLogical boolean Use logical delete on the table?
Author:
Source:
Returns:
Observable | contains the number of lines changed.

find(filter, customWhere)

Function used to find and count and filter data to dababase return values in a given table.
Parameters:
Name Type Description
filter zIFilterDataDB Filter Data Object
customWhere any If the search has any conditions, use an object with the filter values.
Author:
Source:
Returns:

findAll(table, where)

Function used to find all values in a given table.
Parameters:
Name Type Description
table zITableDB Object Table
where any If the search has any conditions, use an object with the filter values.
Author:
Source:
Returns:
Observable | contains the values.

findAndCountAll(table, where)

Function used to find and count all values in a given table.
Parameters:
Name Type Description
table zITableDB Object Table
where any If the search has any conditions, use an object with the filter values.
Author:
Source:
Returns:

generateInnerJoin(table)

Function used to generate inner joins and left joins to select in database.
Parameters:
Name Type Description
table zITableDB Object Table
Author:
Source:
Returns:

update(obj, id, fieldName, tableName)

Function used to update values in a given table.
Parameters:
Name Type Description
obj any Values to Update.
id number Update id.
fieldName string Field Name which is primary key
tableName string Table Name contains in database.
Author:
Source:
Returns:
Observable | contains the number of lines changed.