I'm using the most recent snapshot of neo4j and am having some issues with a cypher query in with @Query.
Example:
@Query(value="START n = node:__types__(className='my.package.Model') MATCH (n)-[:STRING_ATTRIBUTE]->(a) WHERE a.type =~ {t} and a.value = {v} RETURN n", type=QueryType.Cypher)
List<Models> findModels(@Param("t") String type, @Param("v") String value);
When I call my function, i.e. dao.findModels("/(?i)first name/", "/(?i)john|bob/"), I get no results. It will yield results if I use the case sensitive query on one property...but not both.
If I try the query in a template call, I get the results as expected.
Example:
template.query("START n = node:__types__(className='my.package.Model') MATCH (n)-[:STRING_ATTRIBUTE]->(a) WHERE a.type =~ /(?i)first name/ and a.value = /(?i)john|bob/ RETURN n", null);
The @Query also fails if I put valid regex patterns in the value for canned queries.
Example:
@Query(value="START n = node:__types__(className='my.package.Model') MATCH (n)-[:STRING_ATTRIBUTE]->(a) WHERE a.type =~ /(?i){t}/ and a.value = /(?i){v}/ RETURN n", type=QueryType.Cypher)
List<Models> findModels(@Param("t") String type, @Param("v") String value);
I looked through the documentation and didn't notice any limitations for cypher queries in @Query. Is this a bug?


Reply With Quote
