I have a Spring boot webflux application. Its a SAAS application and there will be multiple organization and multiple users from each organization.
So, I store org_id in each table and apply
where org_id=?
in each select, update and delete query.
For Ex:-
Table:- organization
Fields :- org_id, name, ...
Table:- user
Fields :- usr_id, org_id, ...
Table:- schedule
Fields :- schedule_id, usr_id, org_id, ...
Here, I write custom query like below.
@Query("select * from schedule where schedule_id = $1 and org_id = $2")
Flux<Schedule> findById(int scheduleId, int orgId);
Is there any built in support for this use case?