private static Optional<String> determineDeepestMappingInputAttributePath(final Mapping mapping, final Optional<Map<String, Integer>> optionalInputSchemaMap) { return Optional.ofNullable(mapping.getInputAttributePaths()) .filter(mappingInputAttributePathInstances -> !mappingInputAttributePathInstances.isEmpty()) .flatMap(mappingInputAttributePathInstances -> {
final boolean isXmlSchema) { return Optional.ofNullable(mapping.getInputAttributePaths()) .filter(mappingInputAttributePathInstances -> !mappingInputAttributePathInstances.isEmpty()) .flatMap(mappingInputAttributePathInstances -> {
final Set<MappingAttributePathInstance> mappingInputAttributePaths = mapping.getInputAttributePaths();
@Override public boolean completeEquals(final Object obj) { return Mapping.class.isInstance(obj) && super.completeEquals(obj) && DMPPersistenceUtil.getMappingAttributePathInstanceUtils().completeEquals(((Mapping) obj).getInputAttributePaths(), getInputAttributePaths()) && DMPPersistenceUtil.getMappingAttributePathInstanceUtils().completeEquals(((Mapping) obj).getOutputAttributePath(), getOutputAttributePath()) && DMPPersistenceUtil.getComponentUtils().completeEquals(((Mapping) obj).getTransformation(), getTransformation()); } }
final Element rules) throws DMPConverterException { final Set<MappingAttributePathInstance> inputMappingAttributePathInstances = mapping.getInputAttributePaths();
/** * replace attribute paths of MAPIs with persistent ones (we also fetch APs from inbuilt schemata from DB) * * @param oldUuidNewPersistentAttributePathMap * @param project * @throws DMPPersistenceException */ private void replaceAttributePathsInMappings(final Map<String, AttributePath> oldUuidNewPersistentAttributePathMap, final Project project) throws DMPPersistenceException, JsonProcessingException { if (project == null) { return; } final Set<Mapping> existingMappings = project.getMappings(); if (existingMappings == null) { return; } for (final Mapping existingMapping : existingMappings) { final Set<MappingAttributePathInstance> existingMappingInputAttributePaths = existingMapping.getInputAttributePaths(); if (existingMappingInputAttributePaths != null) { for (final MappingAttributePathInstance existingMAPI : existingMappingInputAttributePaths) { replaceAttributePathInMAPI(oldUuidNewPersistentAttributePathMap, existingMAPI); } } final MappingAttributePathInstance existingMappingOutputAttributePath = existingMapping.getOutputAttributePath(); replaceAttributePathInMAPI(oldUuidNewPersistentAttributePathMap, existingMappingOutputAttributePath); } }
/** * {@inheritDoc} */ @Override public void updateObjectInternal(final Mapping object, final Mapping updateObject) throws DMPPersistenceException { super.updateObjectInternal(object, updateObject); final Set<MappingAttributePathInstance> inputAttributePaths = object.getInputAttributePaths(); final MappingAttributePathInstance outputAttributePath = object.getOutputAttributePath(); final Component transformation = object.getTransformation(); updateObject.setInputAttributePaths(inputAttributePaths); updateObject.setOutputAttributePath(outputAttributePath); updateObject.setTransformation(transformation); }
final Set<MappingAttributePathInstance> mappingInputs = mapping.getInputAttributePaths();
/** * {@inheritDoc}<br/> * Updates the name, transformation (component), input attribute paths and output attribute path of the mapping. */ @Override protected Mapping prepareObjectForUpdate(final Mapping objectWithUpdates, final Mapping object) { super.prepareObjectForUpdate(objectWithUpdates, object); object.setTransformation(objectWithUpdates.getTransformation()); object.setInputAttributePaths(objectWithUpdates.getInputAttributePaths()); object.setOutputAttributePath(objectWithUpdates.getOutputAttributePath()); return object; }
if (expectedMapping.getInputAttributePaths() == null || expectedMapping.getInputAttributePaths().isEmpty()) { final boolean actualMappingHasNoInputAttributePaths = (actualMapping.getInputAttributePaths() == null || actualMapping .getInputAttributePaths().isEmpty()); Assert.assertTrue("actual mapping '" + actualMapping.getUuid() + "' shouldn't have input attribute paths", actualMappingHasNoInputAttributePaths); final Set<MappingAttributePathInstance> actualInputAttributePaths = actualMapping.getInputAttributePaths(); for (final MappingAttributePathInstance expectedInputAttributePath : expectedMapping.getInputAttributePaths()) {