Hi, I had a cursory look at the 4.0 docs but there is no where mentioned that @Query is only for methods and cannot be applied to prooerties.
http://docs.spring.io/spring-data/neo4j/docs/4.0.0.M1/reference/html/#reference_programming_model_annotatedQueries Thanks, Sumit On Monday, 20 April 2015 19:27:24 UTC+5:30, Leward wrote: > > Hello, > > With Spring Data Neo4j 3.X I used to have the following in my entities: > > @NodeEntity > public class Agency { > > @GraphId > private Long id; > > private String name > > @Query("start n=node({self}) match n<-[:BELONG_TO]-(u:User) return > count(u);") > private int numberOfEmployees; > > } > > However in SDN 4.0.0M1 the @Query annotation only applies to method. It is > written in the documentation that this works for repository methods, > however nothing is mentioned about using the @Query annotation. > > Does SDN support such a thing? > > If the answer is no, I guess I can make it work in one query with Cypher > (getting the agency and the count of agency members), but then how to map > it back to a proper SDN entity? > > Kind Regards, > Leward > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
