Using Spring Data I've written the code below using the Neo4jTemplate:
When I execute this code I get no results. After verifying that my query works correctly using the Neo4j web console, I rewrote my Spring Data code using the native Neo4j API:
When executing this code I do receive the correct amount of items from the query. Am I doing something wrong here when working with the Neo4jTemplate or is there no support for this type of query built-in in the Neo4jTemplate?
I am having the exact same problem when annotating a field using @Query and setting the value of this annotation to the query I wrote in the previous code fragment.
Code:
Result<Map<String, Object>> result = neo4jTemplate.query(
"START n = node:`n.name`(name = \"name\") MATCH (n)-[c:CONNECTS]->(x) RETURN x ORDER BY c.`order`",
new HashMap<String, Object>()
);
Code:
ExecutionEngine executionEngine = new ExecutionEngine(graphDatabaseService, StringLogger.SYSTEM);
ExecutionResult queryResult = executionEngine.execute(
"START n = node:`n.name`(name = \"name\") MATCH (n)-[c:CONNECTS]->(x) RETURN x ORDER BY c.`order`"
);
I am having the exact same problem when annotating a field using @Query and setting the value of this annotation to the query I wrote in the previous code fragment.