Add web support for Statement
Something like this https://docs.spring.io/spring-data/jpa/reference/repositories/core-extensions.html#core.web.type-safe
Currently it seems not work with Statement.
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `org.neo4j.cypherdsl.core.Statement` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
Test with spring boot 3.3.3
Please add web support, it's very useful for write a complex query api.
Could you have a look here? https://github.com/meistermeier/neo4j-issues-examples/tree/master/gh-2952
This works with a User node and the given properties.
Maybe it is possible to see your controller method and the request query for a better reproducer.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Could you have a look here? https://github.com/meistermeier/neo4j-issues-examples/tree/master/gh-2952 This works with a User node and the given properties.
Do you have cypher DSL version?
Maybe it is possible to see your controller method and the request query for a better reproducer.
My api still work in progress and I want use cypher DSL way seems it is recommended in official reference. https://docs.spring.io/spring-data/neo4j/reference/repositories/sdn-extension.html#sdn-mixins.dynamic-conditions
Also I found there is an official support cypher parser. https://neo4j.github.io/cypher-dsl/2024.1.0/#cypher-parser But it seems need call parse manually instead use in controller directly.
Anyways, I want the api looks like this: request
/search?dsl=123 in someList and name='some ppl name'
code
@PostMapping("/search")
public List<People> search(@RequestParam org.neo4j.cypherdsl.core.Condition dsl) {
return peopleRepository.findAll(dsl);
}
public interface PeopleRepository extends Neo4jRepository<Person, Long>,
CypherdslConditionExecutor<Person>,
CypherdslStatementExecutor<Person> {
}
The parser will just return an AST fragment if you parse in a fragment. That fragment than needs to be added to the shell you did build with the cypher DSL
If it is always a condition, that will work as well and you can use the CypherDSLConditionExecutor.
Here's basically what you want to do:
https://github.com/neo4j/cypher-dsl/blob/0f8cde90ec346ee6d3ddfdd7418b46a97511cad3/neo4j-cypher-dsl-examples/neo4j-cypher-dsl-examples-sdn6/src/main/java/org/neo4j/cypherdsl/examples/sdn6/movies/PeopleService.java#L76-L96
Here's an example to use the CypherDSL with hole statements:
https://github.com/neo4j/cypher-dsl/blob/0f8cde90ec346ee6d3ddfdd7418b46a97511cad3/neo4j-cypher-dsl-examples/neo4j-cypher-dsl-examples-sdn6/src/main/java/org/neo4j/cypherdsl/examples/sdn6/movies/MovieService.java#L52-L74
I think that's actually all you need and I would suggest closing this issue. There's nothing we are gonna add in terms of web support, it's all there already.
I don't get it. Your link is for parse manually, I want parse in controller level automatically. Like my comment here. https://github.com/spring-projects/spring-data-neo4j/issues/2952#issuecomment-2506449636