Spring Data Neo4j

org.springframework.data.neo4j.repository.query
Class DerivedCypherRepositoryQuery

java.lang.Object
  extended by org.springframework.data.neo4j.repository.query.DerivedCypherRepositoryQuery
All Implemented Interfaces:
ParameterResolver, org.springframework.data.repository.query.RepositoryQuery

public class DerivedCypherRepositoryQuery
extends Object

RepositoryQuery implementation that derives a Cypher query from the GraphQueryMethod's method name.

Author:
Oliver Gierke

Constructor Summary
DerivedCypherRepositoryQuery(Neo4jMappingContext mappingContext, GraphQueryMethod queryMethod, Neo4jTemplate template)
          Creates a new DerivedCypherRepositoryQuery from the given MappingContext, GraphQueryMethod and Neo4jTemplate.
 
Method Summary
protected  Object createPage(Iterable<?> result, org.springframework.data.domain.Pageable pageable)
           
protected  String createQueryWithPagingAndSorting(org.springframework.data.repository.query.ParameterAccessor accessor)
          Returns the actual Cypher query applying Pageable or Sort instances.
protected  Object dispatchQuery(String queryString, Map<String,Object> params, org.springframework.data.repository.query.ParameterAccessor accessor)
           
 Object execute(Object[] parameters)
           
protected  QueryEngine<Object> getQueryEngine()
           
 GraphQueryMethod getQueryMethod()
           
protected  Neo4jTemplate getTemplate()
           
 Object resolveParameter(Object value, String parameterName, int index)
           
protected  Map<String,Object> resolveParams(org.springframework.data.repository.query.ParameterAccessor accessor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerivedCypherRepositoryQuery

public DerivedCypherRepositoryQuery(Neo4jMappingContext mappingContext,
                                    GraphQueryMethod queryMethod,
                                    Neo4jTemplate template)
Creates a new DerivedCypherRepositoryQuery from the given MappingContext, GraphQueryMethod and Neo4jTemplate.

Parameters:
mappingContext - must not be null.
queryMethod - must not be null.
template - must not be null.
Method Detail

resolveParameter

public Object resolveParameter(Object value,
                               String parameterName,
                               int index)
Specified by:
resolveParameter in interface ParameterResolver

createQueryWithPagingAndSorting

protected String createQueryWithPagingAndSorting(org.springframework.data.repository.query.ParameterAccessor accessor)
Returns the actual Cypher query applying Pageable or Sort instances.

Parameters:
accessor - parameters
Returns:
query string

getQueryEngine

protected QueryEngine<Object> getQueryEngine()

getTemplate

protected Neo4jTemplate getTemplate()

execute

public Object execute(Object[] parameters)
Specified by:
execute in interface org.springframework.data.repository.query.RepositoryQuery

resolveParams

protected Map<String,Object> resolveParams(org.springframework.data.repository.query.ParameterAccessor accessor)

dispatchQuery

protected Object dispatchQuery(String queryString,
                               Map<String,Object> params,
                               org.springframework.data.repository.query.ParameterAccessor accessor)

getQueryMethod

public GraphQueryMethod getQueryMethod()
Specified by:
getQueryMethod in interface org.springframework.data.repository.query.RepositoryQuery

createPage

protected Object createPage(Iterable<?> result,
                            org.springframework.data.domain.Pageable pageable)

Spring Data Neo4j

Copyright © 2011 SpringSource. All Rights Reserved.