use of com.thinkbiganalytics.metadata.modeshape.common.JcrProperties in project kylo by Teradata.
the class PropertiedMixin method mergeProperties.
/**
* Merges any new properties in with the other Extra Properties
*/
@Override
default Map<String, Object> mergeProperties(Map<String, Object> props) {
Map<String, Object> newProps = new HashMap<>();
Map<String, Object> origProps = getProperties();
if (origProps != null) {
newProps.putAll(origProps);
}
if (props != null) {
newProps.putAll(props);
}
JcrProperties properties = getPropertiesObject();
for (Map.Entry<String, Object> entry : newProps.entrySet()) {
try {
properties.setProperty(entry.getKey(), entry.getValue());
} catch (MetadataRepositoryException e) {
if (ExceptionUtils.getRootCause(e) instanceof ConstraintViolationException) {
// this is ok
} else {
throw e;
}
}
}
return newProps;
}
Aggregations