#5 -- Fix relation
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 59s

This commit is contained in:
Anton Romanov 2025-02-24 21:25:45 +04:00
parent 9f3af7033e
commit 6918f52422
2 changed files with 4 additions and 2 deletions

View File

@ -26,7 +26,7 @@ public class Variable extends BaseEntity {
private boolean input = true;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "variable_id", unique = true)
@JoinColumn(name = "variable_id")
private List<FuzzyTerm> fuzzyTerms = new ArrayList<>();
public Variable() {

View File

@ -36,7 +36,9 @@ public class FuzzyTermService {
term.setDescription(fuzzyTermForm.getDescription());
term.setCrispValue(fuzzyTermForm.getCrispValue());
FuzzyTerm ft = fuzzyTermRepository.save(term);
variableService.addFuzzyTerm(fuzzyTermForm.getVariableId(), ft);
if (fuzzyTermForm.getId() == null || fuzzyTermForm.getId() == 0) {
variableService.addFuzzyTerm(fuzzyTermForm.getVariableId(), ft);
}
return ft;
}