Spring Data Neo4j

org.springframework.data.neo4j.annotation
Annotation Type Query


@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface Query

Field that provides access to an iterator which is created by applying the provided query starting at the current entity-node. The result elements are automatically converted to appropriate element entity class instances.

 @Query(value = "start n=node({self}) match n-[:KNOWS]->other return other", elementClass=Person.class)
 Iterable<Person> friends;
 

Since:
15.09.2010
Author:
Michael Hunger

Optional Element Summary
 Class<?> elementClass
           
 String[] params
           
 QueryType type
           
 String value
           
 

value

public abstract String value
Returns:
Query to be executed {self} will be provided by the node-id of the current entity other parameters (e.g. {name}) by the given named params
Default:
""

elementClass

public abstract Class<?> elementClass
Returns:
target type to convert the single result column (if any) to.
Default:
java.lang.Object.class

params

public abstract String[] params
Returns:
tuple list of parameters that are replaced in the to the @see query-string {"name", value}
Default:
{}

type

public abstract QueryType type
Default:
org.springframework.data.neo4j.annotation.QueryType.Cypher

Spring Data Neo4j

Copyright © 2012 SpringSource. All Rights Reserved.