public List<ResourceEditProperty> loadPropertiesForEditResource(Integer resourceId,
ResourceTypeEntity type, ContextEntity currentContext) {
Map<Integer, ResourceEditProperty> propMap = new HashMap<>();
List<Integer> contextList = contextHierarchy.getContextWithParentIds(currentContext);
List<Integer> typeList = getTypeWithParentIds(null, type);
Query query = queries.getPropertyValueForResource(resourceId, typeList, contextList);
List<ResourceEditProperty> result = JpaSqlResultMapper.list(query, ResourceEditProperty.class);
for (ResourceEditProperty prop : result) {
propMap.put(prop.getDescriptorId(),
findChildPropAndSetParent(prop, propMap.get(prop.getDescriptorId()), contextList));
}
return new ArrayList<>(new TreeSet<>(propMap.values()));
}