bug fix
This commit is contained in:
parent
29836cf362
commit
74526f7927
|
@ -244,7 +244,7 @@ public class DescriptionServiceImpl implements DescriptionService {
|
||||||
|
|
||||||
DescriptionEntity data = this.entityManager.find(DescriptionEntity.class, model.getId());
|
DescriptionEntity data = this.entityManager.find(DescriptionEntity.class, model.getId());
|
||||||
if (data == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), Description.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
if (data == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), Description.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||||
//if (!this.conventionService.hashValue(data.getUpdatedAt()).equals(model.getHash())) throw new MyValidationException(this.errors.getHashConflict().getCode(), this.errors.getHashConflict().getMessage());
|
if (!this.conventionService.hashValue(data.getUpdatedAt()).equals(model.getHash())) throw new MyValidationException(this.errors.getHashConflict().getCode(), this.errors.getHashConflict().getMessage());
|
||||||
|
|
||||||
DescriptionTemplateEntity oldDescriptionTemplateEntity = this.entityManager.find(DescriptionTemplateEntity.class, data.getDescriptionTemplateId());
|
DescriptionTemplateEntity oldDescriptionTemplateEntity = this.entityManager.find(DescriptionTemplateEntity.class, data.getDescriptionTemplateId());
|
||||||
if (oldDescriptionTemplateEntity == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{data.getDescriptionTemplateId(), DescriptionTemplate.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
if (oldDescriptionTemplateEntity == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{data.getDescriptionTemplateId(), DescriptionTemplate.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||||
|
@ -268,9 +268,9 @@ public class DescriptionServiceImpl implements DescriptionService {
|
||||||
data.setDescriptionTemplateId(latestVersionDescriptionTemplates.getFirst().getId());
|
data.setDescriptionTemplateId(latestVersionDescriptionTemplates.getFirst().getId());
|
||||||
|
|
||||||
eu.eudat.commons.types.descriptiontemplate.DefinitionEntity definition = this.xmlHandlingService.fromXmlSafe(eu.eudat.commons.types.descriptiontemplate.DefinitionEntity.class, latestVersionDescriptionTemplates.getFirst().getDefinition());
|
eu.eudat.commons.types.descriptiontemplate.DefinitionEntity definition = this.xmlHandlingService.fromXmlSafe(eu.eudat.commons.types.descriptiontemplate.DefinitionEntity.class, latestVersionDescriptionTemplates.getFirst().getDefinition());
|
||||||
PropertyDefinitionEntity propertyDefinition = this.xmlHandlingService.fromXmlSafe(PropertyDefinitionEntity.class, data.getProperties());
|
PropertyDefinitionEntity propertyDefinition = this.jsonHandlingService.fromJson(PropertyDefinitionEntity.class, data.getProperties());
|
||||||
|
|
||||||
data.setProperties(this.xmlHandlingService.toXml(this.cleanPropertyDefinitionEntity(propertyDefinition, definition)));
|
data.setProperties(this.jsonHandlingService.toJson(this.cleanPropertyDefinitionEntity(propertyDefinition, definition)));
|
||||||
data.setUpdatedAt(Instant.now());
|
data.setUpdatedAt(Instant.now());
|
||||||
this.entityManager.merge(data);
|
this.entityManager.merge(data);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue