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);
}