Skip to content

Conversation

@ctailor2
Copy link
Contributor

This fixes two bugs that caused the return value of JdbcAggregateTemplate#save to be inconsistent with its API contract, under specific situations (see linked issues for more details).

Closes #1199
Closes #1201

…s with immutably typed ids.

+ Added #getIdValueSource to DbAction.WithEntity since it now applies to all such DbAction.
+ Removed DbAction.WithGeneratedId in favor of DbAction.WithEntity where it was used.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 24, 2022
@ctailor2 ctailor2 requested a review from schauder March 24, 2022 15:01
@ctailor2 ctailor2 force-pushed the issue/1201-update-return-value branch from 4ad17f5 to 5f25038 Compare March 24, 2022 20:30
actions.

+ Isolate aggregate change #getEntity #setEntity behaviors into a new
interface for "save" changes.
+ Extract #setEntity from DbAction.WithEntity to a new DbAction interface
just for root actions.
+ JdbcAggregateChangeExecutionContext#populateIdsIfNecessary returns the root entity
from DbAction.InsertRoot or DbAction.UpdateRoot regardless of the immutability of
its @id property.
@ctailor2 ctailor2 force-pushed the issue/1201-update-return-value branch from 5f25038 to 405b093 Compare March 25, 2022 15:15
schauder pushed a commit that referenced this pull request Mar 29, 2022
…s with immutably typed ids.

+ Added #getIdValueSource to DbAction.WithEntity since it now applies to all such DbAction.
+ Removed DbAction.WithGeneratedId in favor of DbAction.WithEntity where it was used.

Removes unused DbAction.Update.

Passes the root from BeforeSaveCallback through to InsertRoot,UpdateRoot
actions.

+ Isolate aggregate change #getEntity #setEntity behaviors into a new
interface for "save" changes.
+ Extract #setEntity from DbAction.WithEntity to a new DbAction interface
just for root actions.
+ JdbcAggregateChangeExecutionContext#populateIdsIfNecessary returns the root entity
from DbAction.InsertRoot or DbAction.UpdateRoot regardless of the immutability of
its @id property.

Closes #1199
Closes #1201
Original pull request #1208
schauder added a commit that referenced this pull request Mar 29, 2022
Formatting and comments.

See #1201
See #1199
Original pull request #1208
@schauder
Copy link
Contributor

Thanks. That's polished and merged.

I didn't backport it since it is breaking some (mostly internal, yet public) API.

@schauder schauder closed this Mar 29, 2022
@schauder schauder deleted the issue/1201-update-return-value branch March 29, 2022 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent JdbcAggregateTemplate#save return value on updates Inconsistent JdbcAggregateTemplate#save return value using BeforeSaveCallback

4 participants