This is essentially an internal transaction helper for trying to apply a changeset to a collection,
used in several higher-level collection utils.
Given the changeset that can represent updates of both types "replace" or "add",
this applies an update join keyed on entityId
for the replace and
appends the new items to get the updated collection.