diff --git a/server/odc-service/src/main/java/com/oceanbase/odc/metadb/schedule/ScheduleTaskRepository.java b/server/odc-service/src/main/java/com/oceanbase/odc/metadb/schedule/ScheduleTaskRepository.java index 548058aaee..63475abba2 100644 --- a/server/odc-service/src/main/java/com/oceanbase/odc/metadb/schedule/ScheduleTaskRepository.java +++ b/server/odc-service/src/main/java/com/oceanbase/odc/metadb/schedule/ScheduleTaskRepository.java @@ -39,7 +39,7 @@ public interface ScheduleTaskRepository extends JpaRepository, JpaSpecificationExecutor { - Optional findByIdAndJobName(Long id, Long scheduleId); + Optional findByIdAndJobName(Long id, String scheduleId); List findByJobNameAndStatusIn(String jobName, List statuses); diff --git a/server/odc-service/src/main/java/com/oceanbase/odc/service/schedule/ScheduleTaskService.java b/server/odc-service/src/main/java/com/oceanbase/odc/service/schedule/ScheduleTaskService.java index 018c3d1c3e..7de1a42f17 100644 --- a/server/odc-service/src/main/java/com/oceanbase/odc/service/schedule/ScheduleTaskService.java +++ b/server/odc-service/src/main/java/com/oceanbase/odc/service/schedule/ScheduleTaskService.java @@ -256,7 +256,8 @@ public ScheduleTaskEntity nullSafeGetById(Long id) { } public ScheduleTask nullSafeGetByIdAndScheduleId(Long id, Long scheduleId) { - Optional scheduleEntityOptional = scheduleTaskRepository.findByIdAndJobName(id, scheduleId); + Optional scheduleEntityOptional = + scheduleTaskRepository.findByIdAndJobName(id, scheduleId.toString()); return scheduleTaskMapper.entityToModel(scheduleEntityOptional .orElseThrow(() -> new NotFoundException(ResourceType.ODC_SCHEDULE_TASK, "id", id))); }