fix tenant scope
This commit is contained in:
parent
d9a59b5570
commit
3e4316a627
|
@ -67,6 +67,13 @@ public class TenantScope {
|
|||
this.tenant.set(tenant);
|
||||
this.tenantCode.set(tenantCode);
|
||||
|
||||
entityManager
|
||||
.unwrap(Session.class)
|
||||
.disableFilter(TenantScopedBaseEntity.TENANT_FILTER);
|
||||
|
||||
entityManager
|
||||
.unwrap(Session.class)
|
||||
.disableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
||||
if (this.tenant.get() != null || this.isDefaultTenant()) {
|
||||
if(!this.isDefaultTenant()) {
|
||||
entityManager
|
||||
|
@ -84,6 +91,15 @@ public class TenantScope {
|
|||
public void removeTempTenant(EntityManager entityManager) {
|
||||
this.tenant.set(this.initialTenant.get());
|
||||
this.tenantCode.set(this.initialTenantCode.get());
|
||||
|
||||
|
||||
entityManager
|
||||
.unwrap(Session.class)
|
||||
.disableFilter(TenantScopedBaseEntity.TENANT_FILTER);
|
||||
|
||||
entityManager
|
||||
.unwrap(Session.class)
|
||||
.disableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
||||
if (this.initialTenant.get() != null || this.isDefaultTenant()) {
|
||||
if(!this.isDefaultTenant()) {
|
||||
entityManager
|
||||
|
|
Loading…
Reference in New Issue