Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class MatrixImage {

@ManyToOne
@JoinColumn(name = "item_id", nullable = false)
@OnDelete(action = OnDeleteAction.CASCADE)
private CarverItem carverItem;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.fmc.starterApp.services;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -8,7 +9,6 @@
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.io.IOException;
import java.util.Set;
import java.util.stream.Collectors;

Expand All @@ -25,9 +25,6 @@
import com.fmc.starterApp.repositories.MatrixImageRepository;
import com.fmc.starterApp.repositories.User2Repository;

import com.fmc.starterApp.repositories.CarverItemRepository;
import com.fmc.starterApp.services.ImageService;

import lombok.AllArgsConstructor;

/**
Expand Down Expand Up @@ -145,6 +142,7 @@ public CarverMatrix getMatrixById(Long matrixId) {
}else{
throw new IllegalArgumentException("CarverMatrix must not be null");
}
return matrix;
} catch (Exception e) {
throw new RuntimeException("Failed to retrieve CarverMatrix with ID: " + matrixId, e);
}
Expand Down Expand Up @@ -511,5 +509,5 @@ public void deleteCarverMatrix(Long matrixId) {
CarverMatrix matrix = carverMatrixRepository.findById(matrixId)
.orElseThrow(() -> new IllegalArgumentException("CarverMatrix not found with ID: " + matrixId));
carverMatrixRepository.delete(matrix);

}
}
Loading