mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-19 23:02:24 +00:00
#2623 - CurrentTenantProvider called even when table has no tenantId column specified
This commit is contained in:
1 parent
585fb9d849
commit
c4a3f43e0d
9 files changed
+81
-15
No files matched your search
@@ -2,13 +2,22 @@ package org.multitenant.partition;
|
||||
|
||||
import io.ebean.config.CurrentTenantProvider;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
class CurrentTenant implements CurrentTenantProvider {
|
||||
|
||||
static AtomicInteger callCounter = new AtomicInteger();
|
||||
|
||||
static int count() {
|
||||
return callCounter.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current tenantId from the user context.
|
||||
*/
|
||||
@Override
|
||||
public String currentId() {
|
||||
callCounter.incrementAndGet();
|
||||
return UserContext.get().getTenantId();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user