Constructor
new TransactionSet()
- Copyright:
- ParaSQL LLC 2013-2023. All rights reserved.
- License:
Extends
- Object
Methods
addNewDataTable(tableName) → {parasql.schema.DataTable}
Parameters:
Name | Type | Description |
---|---|---|
tableName |
string |
Returns:
A newly created DataTable.
discardChanges()
Tells each DataTable in this TransactionSet to discardChanges.
- Description:
Tells each DataTable in this TransactionSet to discardChanges.
getDataTable(tableName) → {parasql.schema.DataTable}
Parameters:
Name | Type | Description |
---|---|---|
tableName |
string |
Throws:
-
If the specified tableName cannot be found in this TransactionSet.
- Type
- Error
Returns:
isDirty() → {boolean}
Returns:
True if this TransactionSet is dirty (contains unsaved changes).
- Type
- boolean
markAsSaved()
Tells each DataTable in this TransactionSet to markAsSaved.
- Description:
Tells each DataTable in this TransactionSet to markAsSaved.
save(callbacknullable)
Cause this TransactionSet to attempt to save all changes to its DataTable objects since the change tracker was last reset.
- Description:
Cause this TransactionSet to attempt to save all changes to its DataTable objects since the change tracker was last reset. New rows will be inserted, modified rows will be updated, and rows marked for delete will be deleted. All operations are performed within a single transaction and committed if successful and rolled back on error. If the save is successful, this TransactionSet will automatically be markAsSaved. This method does nothing if this TransactionSet is not dirty.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function |
<nullable> |
Optional function to be called after this save operation completes; the callback function will be passed a single parameter that is a JSON object with the following structure: {status:string, errorMessage:string} where status will be either OK or ERROR. |