From f972e8305fb16c7d18f9f60a0fa40d9078954420 Mon Sep 17 00:00:00 2001 From: "CITE\\spapacharalampous" Date: Tue, 27 Aug 2024 10:07:46 +0300 Subject: [PATCH] fixes on saving entities with code --- .../descriptiontemplate/DescriptionTemplateServiceImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/service/descriptiontemplate/DescriptionTemplateServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/descriptiontemplate/DescriptionTemplateServiceImpl.java index cd8b81ecd..1d952afa3 100644 --- a/backend/core/src/main/java/org/opencdmp/service/descriptiontemplate/DescriptionTemplateServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/descriptiontemplate/DescriptionTemplateServiceImpl.java @@ -211,8 +211,6 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic if (isUpdate) { this.entityManager.merge(data); } else { - Long descriptionTemplateCodes = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().codes(model.getCode()).count(); - if (descriptionTemplateCodes > 0) throw new MyValidationException(this.errors.getDescriptionTemplateCodeExists().getCode(), this.errors.getDescriptionTemplateCodeExists().getMessage()); this.entityManager.persist(data); this.accountingService.increase(UsageLimitTargetMetric.DESCRIPTION_TEMPLATE_COUNT.getValue()); }