Cascade Delete

Cascade-delete operations on a parent mobile business object (MBO) automatically cascade changes to the child entity.

Relationships

Cascade-delete behavior is controlled by the types of relationships defined for the MBOs:


For MBOs that have existing relationships, when an instance of the source (parent) MBO is deleted, all the associated instances (children) of the target MBO are also deleted. This deletion occurs in the consolidated database (CDB) and is reflected when the device is next synchronized. It can also be reflected with the current synchronization if the deletion is caused by a synchronization request. The cascade deletion is recursive in the sense that when an MBO instance is deleted from the CDB as a cascade deletion, that MBO’s associations are processed and any composition associations trigger additional cascade deletes of second-level MBOs.

Deployment unit

The relationship element has an additional optional attribute type, with values of either composition or reference, as shown:

<association name="items" mobile_object_name="order_item" type=”composition” x_to_many="true">

<association name="product" mobile_object_name="product" type=”reference” x_to_many="true">

Admin API

To specify the relationship type, use the HTTP API with a URL in this format:
http://host:port/onepage/servlet/UWPServlet?app=uep&cmd=MobileObjectAdmin.setAssociationType&package_name=package_name&mobile_object_name=mbo_name&association_name=assoc_name& association_type=type&authenticate.user=userName&authenticate.password=password

Deployment default

During redeployment, if the deployment unit does not specify the relationship type and the relationship already exists in the CDB, then its previous known relationship type is applied. This means you need not set the relationship type after every deployment.