Skip to content

Augment queries - add an additional filter #669

Open
@d0ivanov

Description

@d0ivanov

The application I'm working on is multi-tenant. The approach to tenant data isolation that all tables get an additional "tenant id" column. This results in pretty much every query having a WHERE clause like "...AND tenant_id = ".
I've been evaluating the possibility of customizing query creation and processing so that this additional clause gets appended "automagically" based on the current security context.
So far I've found this issue in Spring Data JPA, but it doesn't seem like there's any active development on it.
So I was wondering what would be your advice on the best approach right now to appending an additional filter to every query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions