nhl / link-move

A model-driven dynamically-configurable framework to acquire data from external sources and save it to your database.
Apache License 2.0
35 stars 15 forks source link

Both new and updated targets must be merged during the "merge" stage #149

Closed andrus closed 6 years ago

andrus commented 6 years ago

Currently new targets are populated with values during the "map" stage, while updated targets - later during the "merge" stage. This is inconsistent in general and complicates things like #145 implementation, as resolving source FKs to target related objects happens in multiple places.

So let's change the algorithm, to avoid immediately merging created objects during the "map" phase. Instead use the "merge" stage to populate the object whether it is new or existing.

Upgrade Notes:

Users should review their use of @AfterTargetsMapped listener to ensure it does not depend on new objects being populated. Potentially @AfterTargetsMerged listener may also be affected, though this is much less likely.