Interface DataContextDelegate

public interface DataContextDelegate

Defines API for a DataContext "delegate" - an object that is temporarily passed control
by DataContext at some critical points in the normal flow of execution. A delegate thus
can modify the flow, abort an operation, modify the objects participating in an
operation, or perform any other tasks it deems necessary. DataContextDelegate is shared
by DataContext and its ObjectStore.

shouldMergeChanges

Invoked by parent DataContext whenever an object change is detected. This can be a
change to the object snapshot, or a modification of an "independent" relationship
not resulting in a snapshot change. In the later case snapshot argument may be
null. If a delegate returns true, ObjectStore will attempt to merge
the changes into an object.

finishedMergeChanges

Called after a successful merging of external changes to an object. If previosly a
delegate returned false from
shouldMergeChanges(DataObject, DataRow), this method is not invoked,
since changes were not merged.

shouldProcessDelete

Invoked by ObjectStore whenever it is detected that a database row was deleted for
object. If a delegate returns true, ObjectStore will change
MODIFIED objects to NEW (resulting in recreating the deleted record on next commit)
and all other objects - to TRANSIENT. To block this behavior, delegate should
return false, and possibly do its own processing.

Parameters:

object - DataObject that was deleted externally and is still present in the
ObjectStore associated with the delegate.

finishedProcessDelete

Called after a successful processing of externally deleted object. If previosly a
delegate returned false from
shouldProcessDelete(DataObject), this method is not invoked, since no
processing was done.