spring-projects / spring-projects/spring-data-relational
Only delete those referenced entities that are no longer present in an aggregate. Use an upsert for all others [DATAJDBC-224]
Open
@schauder is already working on this.
Since Dec 31, 2020.
in: jdbc
type: enhancement
- Dominant language
- Java
- Stars
- 827
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
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.
- Support for upsert/merge statements varies among databases. We might need a fallback.
- 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. - 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.