Reputation: 13
This query always return all node with any proviName
@Query("START n=node:__types__(className='Province') WHERE n.name =~'.*{0}.*' RETURN n")
List<Province> findEntitybyname(String proviName);
How can I fix it?
Upvotes: 1
Views: 75
Reputation: 41676
Inside of a string or regexp no parameter substitution is performed, pass in your query as a string:
@Query("START n=node:__types__(className='Province') WHERE n.name =~ {0} RETURN n")
List<Province> findEntitybyname(String proviName);
repo.findEntitybyname('.*"+proviName+".*');
Upvotes: 1