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
The JdbcAggregateTemplate#save method is expected to return the saved aggregate root with the combined result of the following:
Properties set on the aggregate being saved.
Properties that may be set on the aggregate by the BeforeConvertCallback.
Properties that may be set on the aggregate by the BeforeSaveCallback.
Generated ids for entities that form the aggregate.
Currently the AggregateChangeExecutor#execute method that is called from the JdbcAggregateTemplate either returns the entity on the AggregateChange or the entity on a DbAction.InsertRoot action. This yields an instance with the same properties set under most situations but diverges when the BeforeSaveCallback returns a different instance, for example by updating an immutable property. In this scenario, the return value of AggregateChangeExecutor#execute is the aggregate root with the results of (1), (2), and either of (3) OR (4) from the above, depending on whether the @Id annotated property of the root is mutable.
The text was updated successfully, but these errors were encountered:
ctailor2
changed the title
JdbcAggregateTemplate#save return value behavior is not consistent
Inconsistent JdbcAggregateTemplate#save return value using BeforeSaveCallback
Mar 18, 2022
The
JdbcAggregateTemplate#save
method is expected to return the saved aggregate root with the combined result of the following:BeforeConvertCallback
.BeforeSaveCallback
.Currently the
AggregateChangeExecutor#execute
method that is called from theJdbcAggregateTemplate
either returns the entity on theAggregateChange
or the entity on aDbAction.InsertRoot
action. This yields an instance with the same properties set under most situations but diverges when theBeforeSaveCallback
returns a different instance, for example by updating an immutable property. In this scenario, the return value ofAggregateChangeExecutor#execute
is the aggregate root with the results of (1), (2), and either of (3) OR (4) from the above, depending on whether the@Id
annotated property of the root is mutable.The text was updated successfully, but these errors were encountered: