Skip to content

Commit

Permalink
[NOID] fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed Jan 15, 2025
1 parent 9957bde commit 6f45b54
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import static apoc.util.SystemDbUtil.withSystemDb;

import apoc.SystemLabels;
import apoc.SystemPropertyKeys;
import apoc.util.JsonUtil;
import apoc.util.Util;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.tuple.Pair;
import org.neo4j.graphdb.Node;
import org.neo4j.internal.helpers.collection.Pair;

public class DataVirtualizationCatalogHandlerNewProcedures {

Expand All @@ -19,11 +21,11 @@ public VirtualizedResource install(String databaseName, VirtualizedResource vr)
return withSystemDb(tx -> {
Node node = Util.mergeNode(
tx,
ExtendedSystemLabels.DataVirtualizationCatalog,
SystemLabels.DataVirtualizationCatalog,
null,
Pair.of(SystemPropertyKeys.database.name(), databaseName),
Pair.of(SystemPropertyKeys.name.name(), vr.name));
node.setProperty(ExtendedSystemPropertyKeys.data.name(), JsonUtil.writeValueAsString(vr));
node.setProperty(SystemPropertyKeys.data.name(), JsonUtil.writeValueAsString(vr));
return vr;
});
}
Expand All @@ -32,7 +34,7 @@ public Stream<VirtualizedResource> drop(String databaseName, String name) {
withSystemDb(tx -> {
tx
.findNodes(
ExtendedSystemLabels.DataVirtualizationCatalog,
SystemLabels.DataVirtualizationCatalog,
SystemPropertyKeys.database.name(),
databaseName,
SystemPropertyKeys.name.name(),
Expand All @@ -48,14 +50,14 @@ public Stream<VirtualizedResource> show(String databaseName) {
return withSystemDb(tx -> {
return tx
.findNodes(
ExtendedSystemLabels.DataVirtualizationCatalog,
SystemLabels.DataVirtualizationCatalog,
SystemPropertyKeys.database.name(),
databaseName)
.stream()
.map(node -> {
try {
Map<String, Object> map = JsonUtil.OBJECT_MAPPER.readValue(
node.getProperty(ExtendedSystemPropertyKeys.data.name())
node.getProperty(SystemPropertyKeys.data.name())
.toString(),
Map.class);
String name = node.getProperty(SystemPropertyKeys.name.name())
Expand All @@ -65,7 +67,7 @@ public Stream<VirtualizedResource> show(String databaseName) {
throw new RuntimeException(e);
}
})
.toList()
.collect(Collectors.toList())
.stream();
});
}
Expand Down

0 comments on commit 6f45b54

Please sign in to comment.