Hi Michael,
I don't want to open Pandora's, excuse me, Cypher-DSL's box until I get my test case working.
I've decided to use one property which hopefully filters the most as index lookup and the remaining as where parts like this:
Code:
@Query(value = "start Orig = node:World(name = {name}) WHERE Orig.someOtherProperty = {someOtherProperty} return Orig", type = QueryType.Cypher)
Iterable<World> getAllNamed(@Param("name") String name, @Param("someOtherProperty") String someOtherProperty);
That is working for me and I'm good with the solution atm.
What is not working is this:
Code:
@Query(value = "start Orig = node:World(longNumber = {num}) return Orig", type = QueryType.Cypher)
Iterable<World> getAllByLongNumber(@Param("num") Long number);
@Query(value = "start Orig = node:moonIndex(moons = {num}) return Orig", type = QueryType.Cypher)
Iterable<World> getAllByMoonNumber(@Param("num")int moons);
both return null, the definition in World is
Code:
@Indexed
private Long longNumber;
@Indexed
private String name;
@Indexed
private String someOtherProperty;
@Indexed(indexName = "moonIndex")
private int moons;
It seems, numbers do not work? Neither with the explicitly defined index "moonIndex" nor with the default index used on "someOtherProperty". Is this a bug or did I make a mistake?
Test case is n4jpatest6.zip, not working calls are in App.java line 33 onwards.
As always, any help appreciated