From 0f12ec72911cd8f61ce7687fd48c8cef7d3b0261 Mon Sep 17 00:00:00 2001 From: Luanne Misquitta Date: Mon, 25 Jan 2016 10:31:23 +0530 Subject: [PATCH] DATAGRAPH-765 - Documentation updates for custom query entity mapping. --- .../reference/programming-model/conversion.adoc | 11 +++-------- src/main/asciidoc/reference/setup.adoc | 8 ++++++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/asciidoc/reference/programming-model/conversion.adoc b/src/main/asciidoc/reference/programming-model/conversion.adoc index 6e0b7f955..a7f864083 100644 --- a/src/main/asciidoc/reference/programming-model/conversion.adoc +++ b/src/main/asciidoc/reference/programming-model/conversion.adoc @@ -128,11 +128,6 @@ will take precedence over converters registered with Spring's ConversionService. For queries executed via `@Query` repository methods, it's possible to specify a conversion of complex query results to POJOs. These result objects are then populated with the query result data and can be serialized and sent to a different part of the application, e.g. a frontend-ui. To take advantage of this feature, use a class annotated with `@QueryResult` as the method return type. -[NOTE] -==== -Mapping to entities in a `QueryResult` is not yet supported by Spring Data Neo4j 4. -==== - .Example of query result mapping [source,java] ---- @@ -140,14 +135,14 @@ public interface MovieRepository extends GraphRepository { @Query("MATCH (movie:Movie)-[r:RATING]->(), (movie)<-[:ACTS_IN]-(actor:Actor) " + "WHERE movie.id={0} " + - "RETURN movie.id as movieId, COLLECT(actor.name) AS 'cast', AVG(r.stars) AS 'averageRating'") + "RETURN movie as movie, COLLECT(actor) AS 'cast', AVG(r.stars) AS 'averageRating'") MovieData getMovieData(String movieId); @QueryResult public class MovieData { - Long movieId; + Movie movie; Double averageRating; - Collection cast; + Set cast; } } diff --git a/src/main/asciidoc/reference/setup.adoc b/src/main/asciidoc/reference/setup.adoc index 1c4a1e04a..837ba7e4f 100644 --- a/src/main/asciidoc/reference/setup.adoc +++ b/src/main/asciidoc/reference/setup.adoc @@ -225,7 +225,10 @@ Components.configuration() .setCredentials(credentials); ---- -_Note: Currently only Basic Authentication is supported by Neo4j, so the only Credentials implementation available is `UsernameAndPasswordCredentials`_ +[NOTE] +==== +Currently only Basic Authentication is supported by Neo4j, so the only Credentials implementation available is `UsernameAndPasswordCredentials` +==== === Testing @@ -271,7 +274,8 @@ _Note: Currently only Basic Authentication is supported by Neo4j, so the only Cr [NOTE] ==== -In SDN 4.1, the `InProcessServer` has been deprecated. This class was used to set up an in-memory Http server so that you could run your tests. This is no longer appropriate given the new Driver mechanism, and we recommend you configure an Embedded Driver for your integration tests. +In SDN 4.1, the `InProcessServer` has been deprecated. This class was used to set up an in-memory Http server so that you could run your tests. +This is no longer appropriate given the new Driver mechanism, and we recommend you configure an Embedded Driver (impermanent data store) for your integration tests. ==== === SessionFactory Bean