Getting added, changed, or deleted entities in a bundle

A bundle’s set of entity instances might include multiple types of entities. You can get the set of changes by using properties on the bundle object.

Bundle methods for getting added, changed, or deleted entities

The following table lists the methods that you can use to find bundle changes.

Type of entities to return

Bundle API method

Description

New entity instances

bundle.InsertedBeans

Entity instances in this bundle that are entirely new objects, which have never been committed to the database, appear in this set. This bundle property returns an iterator that iterates across the set of entity instances.

Changed entity instances

bundle.ChangedBeans

Entity instances in this bundle that had one or more properties change appear in this set. This bundle property returns an iterator that iterates across the set of entity instances.

Removed entities

bundle.RemovedBeans

Some entities may be marked for deletion if this bundle commits. If the entity is retireable, the row remains in the database rather than deleted but the entity is marked as retired. This bundle property returns an iterator that iterates across the set of entity instances.

Unmodified entity instances in the current bundle

Not available

An entity might be added to a writable bundle but not yet modified. There is no API method to get the list of unmodified entities in the bundle.