Constructor
new zCrudService()
- Copyright:
- Ivan Antunes 2021
- Source:
Classes
Members
dbService
Stores instance zDatabaseService.
- Copyright:
- Ivan Antunes 2021
- Source:
tService
Stores instance zTranslateService.
- Copyright:
- Ivan Antunes 2021
- Source:
Methods
(static) destroyInstance()
Function used to destroy instance of zCrudService.
- Copyright:
- Ivan Antunes 2021
- Source:
(static) getInstance()
Function used to get instance of zCrudService
- Copyright:
- Ivan Antunes 2021
- 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. |
- Copyright:
- Ivan Antunes 2021
- 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? |
- Copyright:
- Ivan Antunes 2021
- 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. |
- Copyright:
- Ivan Antunes 2021
- 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. |
- Copyright:
- Ivan Antunes 2021
- 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. |
- Copyright:
- Ivan Antunes 2021
- 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 |
- Copyright:
- Ivan Antunes 2021
- 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. |
- Copyright:
- Ivan Antunes 2021
- Source:
Returns:
Observable | contains the number of lines changed.