Skip to content

Conversation

pavel-jm
Copy link
Contributor

Do NOT approve PR just yet - more changes are coming!

result.setNewValue(expression);
}
if (StringUtils.isBlank(oldValue)) {
result.setOldValue(expression);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, the data loader only loads columns that are changing (dataloader.apply.changes.only=true), so by setting the old and new values to the same value, the column will be ignored. The introduction of NewAndOldValue was supposed to be backwards compatible, which is why only newer transforms are using it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with compatibility, but differ on one point:
The only way Old value and New value are the same if
StringUtils.isBlank(newValue) == StringUtils.isBlank(oldValue)

Otherwise values will be different and this is an improvement over existing code, which sends OldValue of NULL (bypassing this transform) to the system, which cannot accept NULLs due to table structure being different from the source database.

@pavel-jm pavel-jm self-assigned this Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants