fixes on saving entities with code
This commit is contained in:
parent
d015c06fef
commit
f972e8305f
|
@ -211,8 +211,6 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
||||||
if (isUpdate) {
|
if (isUpdate) {
|
||||||
this.entityManager.merge(data);
|
this.entityManager.merge(data);
|
||||||
} else {
|
} 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.entityManager.persist(data);
|
||||||
this.accountingService.increase(UsageLimitTargetMetric.DESCRIPTION_TEMPLATE_COUNT.getValue());
|
this.accountingService.increase(UsageLimitTargetMetric.DESCRIPTION_TEMPLATE_COUNT.getValue());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue