-
Notifications
You must be signed in to change notification settings - Fork 131
Use BeforeConvert callback result on non-versioned updates #690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @Value | ||
| @With |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did I change this?
This was the main reason for the test not catching the bug. The problem was that onBeforeConvert(..) was mutating the instance of the entity passed to the callback. This side-effect was spread through the code and reached the private method doUpdate(T entity, SqlIdentifier tableName), making the test think that it was using the value returned by the callback when it was actually using the mutated entity passed through the parameter.
I noticed that other parts of this test are already using immutability through @Value and @With, so I thought it'd make sense to use the same for Person with the minimum possible changes to preserve the behavior of the tests 🙂
entityToUse on non-versioned updates.|
Thank you for your contribution. That's merged, polished, and backported now. |
Closes #689