withDeepUpdate

open fun withDeepUpdate(vararg paths: PropertyPath): EntityValue

Set a flag to mark this entity to be updated by a subsequent DataService.activateDraft call, or by a DataService.updateEntity call that should perform a deep update. Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to paths if paths is non-empty, otherwise set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to null. If paths is empty, the subsequent deep update should include composition children (recursively) which are specified with on-delete-cascade.

See Also:

Update Related Entities When Updating an Entity, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#bindEntity(com.sap.cloud.mobile.kotlin.odata.EntityValue, com.sap.cloud.mobile.kotlin.odata.Property) EntityValue.bindEntity}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#unbindEntity(com.sap.cloud.mobile.kotlin.odata.EntityValue?, com.sap.cloud.mobile.kotlin.odata.Property, kotlin.Boolean) EntityValue.unbindEntity}.

Example with proxy classes:
open fun deepUpdateExample(): kotlin.Unit
{
     val service = this.service;
     val query = DataQuery().top(1).expand(Customer.orders)
         .filter(Customer.contactName.equal("Beverly Crusher"));
     val customer = service.getCustomer(query);
     val orders = customer.orders;
     val firstOrder = orders[0];
     val nextOrder = orders[1];
     val newOrder = Order();
     newOrder.orderDate = GlobalDateTime.now();
     customer.unbindEntity(firstOrder, Customer.orders);
     nextOrder.requiredDate = GlobalDateTime.now().plusDays(7);
     customer.bindEntity(newOrder, Customer.orders);
     customer.deepUpdateDelta = true;
     service.updateEntity(customer.withDeepUpdate());
}

Return

This entity instance.

Parameters

paths

List of property paths (usually {@link com.sap.cloud.mobile.kotlin.odata.Property} instances).