-
Jul 20th, 2012, 02:42 AM
#1
Cypher query in a @Query annotated method is not invoked?!
Hi,
As discussed in previous related thread (http://forum.springsource.org/showth...notated-method)
I have the following @NodeEntity annotated POJO. Its getRelationshipsByType() method always returns empty results despite the fact that there are actually relationships matching the query in the graph db.
@NodeEntity
public class POJO
{
....
private Iterable<POJO> relatedByType;
@Query(value="START n=node({self}) MATCH n-[rel]->relN WHERE type(rel)={relType} RETURN relN")
public Iterable<POJO> getRelationshipsByType(@Param("relType") String type)
{
return relatedByType;
}
...
}
It looks that the query is not executed at all as I tried putting an obviously invalid query like the following and method still returns empty result without any exceptions:
@Query(value="THIS IS AN INVALID QUERY!!! START n=node({self}) MATCH n-[rel]->relN WHERE type(rel)={relType} RETURN relN")
Even checked for annotation name clash - the annotation is of correct type org.springframework.data.neo4j.annotation.Query
What I am doing wrong?
Thank you in advance for any help!
-
Jul 20th, 2012, 04:21 AM
#2
hsherlock,
Might it be a Spring wiring issue?
Could you share a small test project that reproduces the issue?
Because you are right, this should work (i.e. fail), and does work for other users.
Lasse
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules