Skip to content

Only delete those referenced entities that are no longer present in an aggregate. Use an upsert for all others [DATAJDBC-224] #450

Open
@spring-projects-issues

Description

@spring-projects-issues

When updating an aggregate we should not delete all referenced entities in the database.
Instead we should only delete those no longer present in the database and use an upsert/merge on the others.

There are a couple of things to watch out for.

  1. Support for upsert/merge statements varies among databases. We might need a fallback.
  2. entities might have composite ids, in which case a simple in ( ... ) might not work. We need to figure out how we might construct an equivalent statement for the supported databases.
  3. Databases and drivers will have various limits for length of SQL statements. We should at least know about these and take them into consideration.

This is a subtask of #437

Jens Schauder opened this as DATAJDBC-224

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions