5-save-rules #15

Merged
romanov73 merged 13 commits from 5-save-rules into master 2025-02-24 21:26:14 +04:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 6918f52422 - Show all commits

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;
}