Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>1.8.0.BUILD-SNAPSHOT</version>
<relativePath>../spring-data-build/parent/pom.xml</relativePath>
<relativePath />
</parent>

<modules>
Expand Down
4 changes: 2 additions & 2 deletions src/main/asciidoc/overriding-sdr-response-handlers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ This controller will be served from the same API base path defined in `Repositor

<1> This example uses constructor injection.
<2> This handler plugs in a custom handler for a Spring Data finder method.
<3> This handler is using the underlying repository to fetch data, but will tehn do some form of post processing before returning the final data set to the client.
<3> This handler is using the underlying repository to fetch data, but will then do some form of post processing before returning the final data set to the client.
<4> The results need to be wrapped up in a Spring HATEOAS `Resources` object to return a collection, but only a `Resource` for a single item.
<5> Add a link back to this exact method as a "self" link.
<6> Returning the collection using Spring MVC's `ResponseEntity` wrapper ensure the collection is properly wrapped and rendered in the proper accept type.

`Resources` is for a collection while `Resource` is for a single item. These types can be combined. If you know the links for each item in a collection, use `Resources<Resource<String>>` (or whatever the core domain type is). This lets you assembled links for each item as well as for the whole collection.
`Resources` is for a collection while `Resource` is for a single item. These types can be combined. If you know the links for each item in a collection, use `Resources<Resource<String>>` (or whatever the core domain type is). This lets you assemble links for each item as well as for the whole collection.

IMPORTANT: In this example, the combined path will be `RepositoryRestConfiguration.getBasePath()` + `/scanners/search/listProducers`.

Expand Down
8 changes: 4 additions & 4 deletions src/main/asciidoc/projections-excerpts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ It's possible to have multiple projections.

NOTE: Visit <<spring-data-examples.projections>> to see an example project you can experiment with.

How does Spring Data REST finds projection defintions?
How does Spring Data REST finds projection definitions?

* Any `@Projection` interface found in the same package as your entity definitions (or one of it's sub-packages) is registered.
* You can manually register via `RepositoryRestConfiguration.projectionConfiguration().addProjection(…)`.
* You can manually register via `RepositoryRestConfiguration.getProjectionConfiguration().addProjection(…)`.

In either situtation, the interface with your projection MUST have the `@Projection` annotation.
In either situation, the interface with your projection MUST have the `@Projection` annotation.

[[projections-excerpts.finding-projections]]
=== Finding existing projections
Expand Down Expand Up @@ -185,7 +185,7 @@ Spring Data REST exposes <<metadata.alps>> documents, a micro metadata format. T
Projection definitions will be picked up and made available for clients if they are:

* Flagged with the `@Projection` annotation and located in the same package (or sub-package) of the domain type, OR
* Manually registered via `RepositoryRestConfiguration.projectionConfiguration().addProjection(…)`.
* Manually registered via `RepositoryRestConfiguration.getProjectionConfiguration().addProjection(…)`.
====

[[projections-excerpts.projections.hidden-data]]
Expand Down