join Transaction
Set the {@link com.sap.cloud.mobile.kotlin.odata.RequestOptions#joinChangeSet RequestOptions.joinChangeSet} to the provided 'entity' and return this options object. The provided entity should elsewhere be specified for a createEntity / updateEntity / deleteEntity as the first request within a change set.
- Example using proxy classes:
open fun joinTransactionExample(patient: Patient): kotlin.Unit { val service = this.healthService; val changes = ChangeSet(); val appointment1 = Appointment(); changes.createEntity(patient); changes.createRelatedEntity(appointment1, patient, Patient.appointments); service.applyChanges(changes); // Some time later... Attach another appointment to the same transaction as the patient. val appointment2 = Appointment(); changes.createRelatedEntity(appointment2, patient, Patient.appointments, com.sap.cloud.mobile.kotlin.odata.http.HttpHeaders.empty, RequestOptions() .joinTransaction(patient)); // Some time later... Upload the patient and both appointments in the same backend transaction. service.upload(); }
Return
This options object.
Parameters
entity
Reference to an entity to be copied into {@link com.sap.cloud.mobile.kotlin.odata.RequestOptions#joinChangeSet RequestOptions.joinChangeSet}.