Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit 8bd5104

Browse files
committed
Convert to UUID for trial delete
1 parent 18faec7 commit 8bd5104

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/org/brapi/test/BrAPITestServer/repository/core/TrialRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Page<TrialEntity> findBySearch(
2929
@Modifying
3030
@Transactional
3131
@Query("UPDATE TrialEntity t SET t.softDeleted = :softDeleted WHERE t.id = :trialId")
32-
int updateSoftDeletedStatus(@Param("trialId") String trialId, @Param("softDeleted") boolean softDeleted);
32+
int updateSoftDeletedStatus(@Param("trialId") UUID trialId, @Param("softDeleted") boolean softDeleted);
3333

3434
@Modifying
3535
@Transactional
3636
@Query("UPDATE TrialEntity t SET t.softDeleted = :softDeleted WHERE t.id IN :trialIds")
37-
int updateSoftDeletedStatusBatch(@Param("trialIds") List<String> trialIds, @Param("softDeleted") boolean softDeleted);
37+
int updateSoftDeletedStatusBatch(@Param("trialIds") List<UUID> trialIds, @Param("softDeleted") boolean softDeleted);
3838

3939
}

src/main/java/org/brapi/test/BrAPITestServer/service/core/TrialService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ public void deleteTrialBatch(List<String> trialDbIds) {
175175
}
176176

177177
public void softDeleteTrialBatch(List<String> trialDbIds) {
178-
trialRepository.updateSoftDeletedStatusBatch(trialDbIds, true);
178+
trialRepository.updateSoftDeletedStatusBatch(trialDbIds.stream().map(UUID::fromString).toList(), true);
179179
}
180180

181181
public void softDeleteTrial(String trialDbId) throws BrAPIServerDbIdNotFoundException {
182-
int updatedCount = trialRepository.updateSoftDeletedStatus(trialDbId, true);
182+
int updatedCount = trialRepository.updateSoftDeletedStatus(UUID.fromString(trialDbId), true);
183183
if (updatedCount == 0) {
184184
throw new BrAPIServerDbIdNotFoundException("trial", trialDbId, "trial database ID", HttpStatus.NOT_FOUND);
185185
}

0 commit comments

Comments
 (0)