spring-projects / spring-projects/spring-data-commons

Add infrastructure for generic query augmentation [DATACMNS-293]

Open
#766 35 comments 11 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 30, 2020.

has: votes-jira in: repository type: enhancement
Dominant language
Java
Stars
838
Forks
730
PR merge metrics
No merged PRs in 30d

Description

Oliver Drotbohm opened DATACMNS-293 and commented

When working with repositories there might be use cases that involve the queries to be executed for that repository to contain some kind of global criteria. A good example for such a scenario is ACL based security to domain objects, e.g. with a global criteria causing the repository to only return domain objects created by the current user or only objects the current user is allowed to read.

A related example is working with data that has a soft-delete flag and essentially has to consider objects with that flag set to true non-existant.

Implementing these kinds of scenarios require the queries to the underlying store to be augmented with additional criterias. So we need to come up with some an SPI to prepare the query about to be executed and potentially even alter a delete(…) call into an update (for the soft-delete case).

From a more general point of view we need access to the method the query is executed for and it's associated metadata


Issue Links:

  • SEC-2409 Spring Security / Spring Data Acl Integration
    ("is depended on by")

  • DATAMONGO-1151 Introduce ability to append queries against a particular collection
    ("is depended on by")

  • DATAJPA-307 Add support for soft deletes

  • DATAJPA-1551 Create an API to customize query creation and query processing

116 votes, 92 watchers

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.