DATAREST-577 - Excerpt projections are now configured automatically.

Excerpt projections defined in @RepositoryRestResource had to be discoverable (i.e. located in a sub-package of the domain type). RepositoryRestMvcConfiguration now uses an newly introduced constructor of ProjectionDefinitionConfiguration that automatically registers all projects in the given ResourceMappings.
This commit is contained in:
Oliver Gierke
2015-06-11 20:12:40 +02:00
parent 5f091a68f8
commit 3e0402b70b
3 changed files with 49 additions and 6 deletions

View File

@@ -217,8 +217,9 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
@Bean
public RepositoryRestConfiguration config() {
ProjectionDefinitionConfiguration configuration = new ProjectionDefinitionConfiguration();
ProjectionDefinitionConfiguration configuration = new ProjectionDefinitionConfiguration(resourceMappings());
// Register projections found in packages
for (Class<?> projection : getProjections(repositories())) {
configuration.addProjection(projection);
}