public class DifferenceApplier
extends java.lang.Object
GenericBeanDiffer
Constructor and Description |
---|
DifferenceApplier(DBObjectProvider pro)
Creates a DifferenceApplier that will apply differences in a ResultSet from
b() to a().
|
DifferenceApplier(DBObjectProvider pro,
boolean applyToB)
Creates a DifferenceApplier specfiying which way to apply differences.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(Difference rs)
Applys changes in the direction specified when this applier was
constructed.
|
void |
apply(SystemObject original,
SystemObject updated)
Applys changes in the direction specified when this applier was
constructed.
|
DBObjectChange[] |
fireEvents()
Deprecated.
|
static DBObjectChange |
fireLazyChangeEvent(SystemObject obj,
SystemObject copyOfOriginal,
DBObjectProvider pro)
Creates and fires a DBObjectChange event for the given object.
|
SystemObject |
getCopyOfOrigWithDiffApplied(Difference diff)
Gets a new temporary copy of the original object in the given
difference and applys all the changes in the difference to that object.
|
java.lang.Iterable<DBObjectChange> |
getEvents()
Gets the change events that the applied Differences have produced.
|
public DifferenceApplier(DBObjectProvider pro)
public DifferenceApplier(DBObjectProvider pro, boolean applyToB)
applyToB
- if true, differences in a() will be applied to b(),
otherwise b() is considered to hold the updates which will be applied to
a().public final void apply(SystemObject original, SystemObject updated)
public final void apply(Difference rs)
public SystemObject getCopyOfOrigWithDiffApplied(Difference diff)
Note it is unlikely that you would want to call this method with an unfiltered Difference as it would be a waste of time.
@Deprecated public DBObjectChange[] fireEvents()
public java.lang.Iterable<DBObjectChange> getEvents()
public static DBObjectChange fireLazyChangeEvent(SystemObject obj, SystemObject copyOfOriginal, DBObjectProvider pro)
obj
- the object to fire the event onupdateCopy
- a copy of the last know state of the object.