if (newUuid != null && !currentUuid.equals(newUuid)) {
final MetadataRepository metadataRepository = context.getBean(MetadataRepository.class);
final SourceRepository sourceRepository = context.getBean(SourceRepository.class);
final Source source = sourceRepository.findOne(currentUuid);
Source newSource = new Source(newUuid, source.getName(), source.isLocal());
sourceRepository.save(newSource);
PathSpec<Metadata, String> servicesPath = new PathSpec<Metadata, String>() {
@Override
public Path<String> getPath(Root<Metadata> root) {
return root.get(Metadata_.sourceInfo).get(MetadataSourceInfo_.sourceId);