Merge pull request #13479 from thingsboard/fix/edqs

Fix EntityFields customerId
This commit is contained in:
Viacheslav Klimov 2025-05-30 12:04:24 +03:00 committed by GitHub
commit 712117fc26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,7 @@ package org.thingsboard.server.common.data.edqs.fields;
import lombok.Data;
import lombok.experimental.SuperBuilder;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.EntityId;
import java.util.UUID;
@ -36,7 +36,7 @@ public class AbstractEntityFields implements EntityFields {
this.id = id;
this.createdTime = createdTime;
this.tenantId = tenantId;
this.customerId = (customerId != null && customerId != CustomerId.NULL_UUID) ? customerId : null;
this.customerId = checkId(customerId);
this.name = name;
this.version = version;
}
@ -62,4 +62,8 @@ public class AbstractEntityFields implements EntityFields {
this(id, createdTime, tenantId, null, null, null);
}
protected UUID checkId(UUID id) {
return id != null && !id.equals(EntityId.NULL_UUID) ? id : null;
}
}