Skip to content
Snippets Groups Projects
Commit f528a0e1 authored by Adam Laskowski's avatar Adam Laskowski
Browse files

SSDM-55: changed how property values are provided for EntityPropertiesConverter

parent e7f9ee82
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -268,7 +268,7 @@ public final class EntityPropertiesConverter implements IEntityPropertiesConvert
{
final String propertyCode = property.getPropertyType().getCode();
final PropertyTypePE propertyType = getPropertyType(propertyCode);
final Serializable valueOrNull = property.getValue();
final Serializable valueOrNull = getPropertyValue(property);
ExtendedEntityTypePropertyType extendedETPT =
getEntityTypePropertyType(entityTypePE, propertyType);
final EntityTypePropertyTypePE entityTypePropertyTypePE =
......@@ -306,6 +306,26 @@ public final class EntityPropertiesConverter implements IEntityPropertiesConvert
return null;
}
private Serializable getPropertyValue(final IEntityProperty property) {
Serializable result = property.getValue();
if(result != null) {
return result;
}
result = property.getVocabularyTerm();
if(result != null) {
return result;
}
result = property.getSample();
if(result != null) {
return result;
}
result = property.getMaterial();
if(result != null) {
return result;
}
return property.tryGetAsString();
}
private final <T extends EntityPropertyPE> List<T> createEntityProperty(
final PersonPE registrator,
final PropertyTypePE propertyType,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment