private static final String QUERY_ACROSS_ANCHORS = null;
private static final AnchorEntity ALL_ANCHORS = null;
- @Override
- public void addChildDataNode(final String dataspaceName, final String anchorName, final String parentNodeXpath,
- final DataNode newChildDataNode) {
- final AnchorEntity anchorEntity = getAnchorEntity(dataspaceName, anchorName);
- addNewChildDataNode(anchorEntity, parentNodeXpath, newChildDataNode);
- }
-
@Override
public void addChildDataNodes(final String dataspaceName, final String anchorName,
final String parentNodeXpath, final Collection<DataNode> dataNodes) {
private FragmentEntity toFragmentEntity(final AnchorEntity anchorEntity, final DataNode dataNode) {
return FragmentEntity.builder()
- .dataspace(anchorEntity.getDataspace())
.anchor(anchorEntity)
.xpath(dataNode.getXpath())
.attributes(jsonObjectMapper.asJsonString(dataNode.getLeaves()))
fragmentRepository.findExtractsWithDescendantsByIds(fragmentEntityIds, fetchDescendantsOption.getDepth());
if (anchorEntity == ALL_ANCHORS) {
- final Collection<Integer> anchorIds = fragmentExtracts.stream()
+ final Collection<Long> anchorIds = fragmentExtracts.stream()
.map(FragmentExtract::getAnchorId).collect(Collectors.toSet());
final List<AnchorEntity> anchorEntities = anchorRepository.findAllById(anchorIds);
- final Map<Integer, AnchorEntity> anchorEntityPerId = anchorEntities.stream()
+ final Map<Long, AnchorEntity> anchorEntityPerId = anchorEntities.stream()
.collect(Collectors.toMap(AnchorEntity::getId, Function.identity()));
return FragmentEntityArranger.toFragmentEntityTreesAcrossAnchors(anchorEntityPerId, fragmentExtracts);
}
private String mergeLeaves(final Map<String, Serializable> updateLeaves, final String currentLeavesAsString) {
Map<String, Serializable> currentLeavesAsMap = new HashMap<>();
if (currentLeavesAsString != null) {
- currentLeavesAsMap = currentLeavesAsString.isEmpty()
- ? new HashMap<>() : jsonObjectMapper.convertJsonString(currentLeavesAsString, Map.class);
+ currentLeavesAsMap = jsonObjectMapper.convertJsonString(currentLeavesAsString, Map.class);
currentLeavesAsMap.putAll(updateLeaves);
}