|
|
|
@ -35,6 +35,7 @@ import org.thingsboard.server.dao.device.DeviceService; |
|
|
|
import org.thingsboard.server.dao.entity.AbstractEntityService; |
|
|
|
import org.thingsboard.server.dao.entityview.EntityViewService; |
|
|
|
import org.thingsboard.server.dao.exception.DataValidationException; |
|
|
|
import org.thingsboard.server.dao.resource.ResourceService; |
|
|
|
import org.thingsboard.server.dao.rule.RuleChainService; |
|
|
|
import org.thingsboard.server.dao.service.DataValidator; |
|
|
|
import org.thingsboard.server.dao.service.PaginatedRemover; |
|
|
|
@ -88,6 +89,9 @@ public class TenantServiceImpl extends AbstractEntityService implements TenantSe |
|
|
|
@Autowired |
|
|
|
private RuleChainService ruleChainService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ResourceService resourceService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Tenant findTenantById(TenantId tenantId) { |
|
|
|
log.trace("Executing findTenantById [{}]", tenantId); |
|
|
|
@ -140,6 +144,7 @@ public class TenantServiceImpl extends AbstractEntityService implements TenantSe |
|
|
|
userService.deleteTenantAdmins(tenantId); |
|
|
|
ruleChainService.deleteRuleChainsByTenantId(tenantId); |
|
|
|
apiUsageStateService.deleteApiUsageStateByTenantId(tenantId); |
|
|
|
resourceService.deleteResourcesByTenantId(tenantId); |
|
|
|
tenantDao.removeById(tenantId, tenantId.getId()); |
|
|
|
deleteEntityRelations(tenantId, tenantId); |
|
|
|
} |
|
|
|
|