You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When aggregates are designed to be effectively immutable, e.g. by providing with…(…) methods, the state of the synthetic is-new flag introduced via the ByteBuddy plugin is not transferred to the fresh instance created as the user code doesn't know about it.
Imagine a Sample instance created and persisted. It'll end up with the is-new flag set to false. Calling withStatus(…) however will result the new instance that is effectively considered the same aggregate (same identifier) but has the is-new flag reset to true.
A first attempt to solve the problem might be to attach to the wither convention and post process object instances returned for those to transfer the flag if the type returned is the current type or a specialized flavor of it.
The text was updated successfully, but these errors were encountered:
When aggregates are designed to be effectively immutable, e.g. by providing
with…(…)
methods, the state of the synthetic is-new flag introduced via the ByteBuddy plugin is not transferred to the fresh instance created as the user code doesn't know about it.Imagine a
Sample
instance created and persisted. It'll end up with the is-new flag set to false. CallingwithStatus(…)
however will result the new instance that is effectively considered the same aggregate (same identifier) but has the is-new flag reset totrue
.A first attempt to solve the problem might be to attach to the wither convention and post process object instances returned for those to transfer the flag if the type returned is the current type or a specialized flavor of it.
The text was updated successfully, but these errors were encountered: