diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/AiSettingsFields.java b/common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/AiSettingsFields.java deleted file mode 100644 index 751c8538f0..0000000000 --- a/common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/AiSettingsFields.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright © 2016-2025 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.common.data.edqs.fields; - -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -import java.util.UUID; - -@Data -@EqualsAndHashCode(callSuper = true) -@NoArgsConstructor -public class AiSettingsFields extends AbstractEntityFields { - - private String provider; - private String model; - private String apiKey; - - public AiSettingsFields(UUID id, long createdTime, UUID tenantId, long version, String provider, String name, String model, String apiKey) { - super(id, createdTime, tenantId, name, version); - this.provider = provider; - this.model = model; - this.apiKey = apiKey; - } - -} diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/ai/AiSettingsRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/ai/AiSettingsRepository.java index b64fc99bcb..109557095d 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sql/ai/AiSettingsRepository.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/ai/AiSettingsRepository.java @@ -35,12 +35,7 @@ public interface AiSettingsRepository extends JpaRepository findByTenantIdAndId(UUID tenantId, UUID id); - @Query("SELECT new org.thingsboard.server.common.data.edqs.fields.AiSettingsFields(" + - "ai.id, ai.createdTime, ai.tenantId, ai.version, ai.provider, ai.name, ai.model, ai.apiKey) " + - "FROM AiSettingsEntity ai WHERE ai.id > :id ORDER BY ai.id") - List findNextBatch(@Param("id") UUID id, Limit limit); - - Long countByTenantId(UUID tenantId); + long countByTenantId(UUID tenantId); @Transactional void deleteByTenantId(UUID tenantId);