Skip to content

Inconsistent JdbcAggregateTemplate#save return value on updates #1201

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

Closed
ctailor2 opened this issue Mar 18, 2022 · 0 comments
Closed

Inconsistent JdbcAggregateTemplate#save return value on updates #1201

ctailor2 opened this issue Mar 18, 2022 · 0 comments
Assignees
Labels
type: bug A general bug

Comments

@ctailor2
Copy link
Contributor

The JdbcAggregateTemplate#save method is expected to return the saved aggregate root with the result of, among other things, any generated ids for entities that form the aggregate.

For updates to an aggregate where one or more referenced entities are replaced and the referenced entity type has an immutable @Id annotated property, the newly generated ids for the replacement referenced entities are not reflected in the return value from JdbcAggregateTemplate#save. The post-execution processing of generated ids that occurs in JdbcAggregateChangeExecutionContext#populateIdsIfNecessary does not consider that the entity on a DbAction.UpdateRoot may need to have entity references corrected when these references have newly generated immutably typed ids.

Related to #1199.

@ctailor2 ctailor2 self-assigned this Mar 18, 2022
@ctailor2 ctailor2 added the type: bug A general bug label Mar 18, 2022
schauder added a commit that referenced this issue Mar 29, 2022
Formatting and comments.

See #1201
See #1199
Original pull request #1208
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant