Assuming state-less communication, each single data modification request (or change set in an OData $batch request) is a "mini-transaction", which saves data to the database. The class allows you to submit changes, invoke actions, OData CRUD operations in general, and trigger client-side validations. It ensures concurrency control and correct ETag handling.
The class gives access to runtime draft handling for applications. Additionally error handling capabilities are provided to notify client implementations of error situations. The event fatalError
is thrown, if fatal errors occur during execution of OData requests.
Constructor for a new transaction controller instance.
new sap.ui.generic.app.transaction.TransactionController(oModel, oQueue, mParams)
Param | Type | Default Value | Description |
---|---|---|---|
oModel | sap.ui.model.odata.ODataModel | The OData model currently used |
|
oQueue | sap.ui.generic.app.util.Queue | Optional HTTP request queue |
|
mParams | Object<string,any> | Optional configuration parameters |
|
noBatchGroups | boolean | Suppresses creation of batch groups |
Method | Description |
---|---|
deleteEntities |
Submits changes to the backend system and deletes a group of entities in the backend system. These entities can be both draft or active entities. |
deleteEntity |
Submits changes to the backend system and deletes an entity in the backend system. This entity can be either a draft or an active entity. |
destroy |
Frees all resources claimed during the life-time of this instance. |
editEntity |
Prepares an entity for editing. If the entity is active and draft enabled, a new draft document is created. If not, the control is automatically returned to the caller of the method by returning a resolved promise. |
sap.ui.generic.app.transaction.TransactionController.extend |
Creates a new subclass of class sap.ui.generic.app.transaction.TransactionController with name
|
getDraftController |
Returns the current draft controller instance. |
sap.ui.generic.app.transaction.TransactionController.getMetadata |
Returns a metadata object for class sap.ui.generic.app.transaction.TransactionController. |
resetChanges |
Resets changes that have been tracked by the current instance of |
Submits changes to the backend system and deletes a group of entities in the backend system. These entities can be both draft or active entities.
Param | Type | DefaultValue | Description |
---|---|---|---|
aEntities | array |
Binding contexts or paths (strings) which identify the entities |
|
mParameters | Object<string,any> |
Parameters that control the behavior of the request |
Submits changes to the backend system and deletes an entity in the backend system. This entity can be either a draft or an active entity.
Param | Type | DefaultValue | Description |
---|---|---|---|
vEntity | sap.ui.model.Context string |
Binding context or path of the entity |
|
mParameters | Object<string,any> |
Parameters that control the behavior of the request |
Prepares an entity for editing. If the entity is active and draft enabled, a new draft document is created. If not, the control is automatically returned to the caller of the method by returning a resolved promise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContext | sap.ui.model.Context |
The given binding context |
|
bPreserveChanges | boolean |
Set to |
|
sRootExpand | string |
indicates whether root needs to expanded |
Creates a new subclass of class sap.ui.generic.app.transaction.TransactionController with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.generic.app.transaction.BaseController.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |