Browse Source

add todo notes

pull/5873/head
desoliture 5 years ago
parent
commit
ba030b07b1
  1. 1
      dao/src/main/java/org/thingsboard/server/dao/alarm/BaseAlarmService.java
  2. 2
      dao/src/main/java/org/thingsboard/server/dao/asset/BaseAssetService.java
  3. 1
      dao/src/main/java/org/thingsboard/server/dao/customer/CustomerServiceImpl.java
  4. 2
      dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardServiceImpl.java
  5. 1
      dao/src/main/java/org/thingsboard/server/dao/device/DeviceProfileServiceImpl.java
  6. 1
      dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java
  7. 1
      dao/src/main/java/org/thingsboard/server/dao/edge/EdgeServiceImpl.java
  8. 1
      dao/src/main/java/org/thingsboard/server/dao/entityview/EntityViewServiceImpl.java

1
dao/src/main/java/org/thingsboard/server/dao/alarm/BaseAlarmService.java

@ -431,6 +431,7 @@ public class BaseAlarmService extends AbstractEntityService implements AlarmServ
throw new DataValidationException("Alarm should be assigned to tenant!");
} else {
Tenant tenant = tenantService.findTenantById(alarm.getTenantId());
// TODO: 13.01.22 Instead of finding and checking for null need to create and use tenantService.exists()
if (tenant == null) {
throw new DataValidationException("Alarm is referencing to non-existent tenant!");
}

2
dao/src/main/java/org/thingsboard/server/dao/asset/BaseAssetService.java

@ -417,7 +417,7 @@ public class BaseAssetService extends AbstractEntityService implements AssetServ
throw new DataValidationException("Asset should be assigned to tenant!");
} else {
Tenant tenant = tenantService.findTenantById(asset.getTenantId());
// FIXME: 12.01.22
// TODO: 13.01.22 Instead of finding and checking for null need to create and use tenantService.exists()
if (tenant == null) {
throw new DataValidationException("Asset is referencing to non-existent tenant!");
}

1
dao/src/main/java/org/thingsboard/server/dao/customer/CustomerServiceImpl.java

@ -211,6 +211,7 @@ public class CustomerServiceImpl extends AbstractEntityService implements Custom
throw new DataValidationException("Customer should be assigned to tenant!");
} else {
Tenant tenant = tenantService.findTenantById(customer.getTenantId());
// TODO: 13.01.22 Instead of finding and checking for null need to create and use tenantService.exists()
if (tenant == null) {
throw new DataValidationException("Customer is referencing to non-existent tenant!");
}

2
dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardServiceImpl.java

@ -309,7 +309,7 @@ public class DashboardServiceImpl extends AbstractEntityService implements Dashb
throw new DataValidationException("Dashboard should be assigned to tenant!");
} else {
Tenant tenant = tenantService.findTenantById(dashboard.getTenantId());
// FIXME: 12.01.22
// TODO: 13.01.22 Instead of finding and checking for null need to create and use tenantService.exists()
if (tenant == null) {
throw new DataValidationException("Dashboard is referencing to non-existent tenant!");
}

1
dao/src/main/java/org/thingsboard/server/dao/device/DeviceProfileServiceImpl.java

@ -376,6 +376,7 @@ public class DeviceProfileServiceImpl extends AbstractEntityService implements D
throw new DataValidationException("Device profile should be assigned to tenant!");
} else {
Tenant tenant = tenantService.findTenantById(deviceProfile.getTenantId());
// TODO: 13.01.22 Instead of finding and checking for null need to create and use tenantService.exists()
if (tenant == null) {
throw new DataValidationException("Device profile is referencing to non-existent tenant!");
}

1
dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java

@ -742,6 +742,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe
throw new DataValidationException("Device should be assigned to tenant!");
} else {
Tenant tenant = tenantService.findTenantById(device.getTenantId());
// TODO: 13.01.22 Instead of finding and checking for null need to create and use tenantService.exists()
if (tenant == null) {
throw new DataValidationException("Device is referencing to non-existent tenant!");
}

1
dao/src/main/java/org/thingsboard/server/dao/edge/EdgeServiceImpl.java

@ -414,6 +414,7 @@ public class EdgeServiceImpl extends AbstractEntityService implements EdgeServic
throw new DataValidationException("Edge should be assigned to tenant!");
} else {
Tenant tenant = tenantService.findTenantById(edge.getTenantId());
// TODO: 13.01.22 Instead of finding and checking for null need to create and use tenantService.exists()
if (tenant == null) {
throw new DataValidationException("Edge is referencing to non-existent tenant!");
}

1
dao/src/main/java/org/thingsboard/server/dao/entityview/EntityViewServiceImpl.java

@ -433,6 +433,7 @@ public class EntityViewServiceImpl extends AbstractEntityService implements Enti
throw new DataValidationException("Entity view should be assigned to tenant!");
} else {
Tenant tenant = tenantService.findTenantById(entityView.getTenantId());
// TODO: 13.01.22 Instead of finding and checking for null need to create and use tenantService.exists()
if (tenant == null) {
throw new DataValidationException("Entity view is referencing to non-existent tenant!");
}

Loading…
Cancel
Save