DATAREST-1381 - Improve documentation around @RepositoryRestController.
This commit is contained in:
@@ -48,6 +48,14 @@ public class ScannerController {
|
||||
|
||||
IMPORTANT: In this example, the combined path is `RepositoryRestConfiguration.getBasePath()` + `/scanners/search/listProducers`.
|
||||
|
||||
[[customizing-sdr.overriding-sdr-response-handlers.annotations]]
|
||||
== @RepositoryRestResource VS. @BasePathAwareController
|
||||
|
||||
If you are not interested in entity-specific operations but still want to build custom operations underneath `basePath`, such as Spring MVC views, resources, and others, use `@BasePathAwareController`.
|
||||
If you're using `@RepositoryRestResource` on your custom controller, it will only handle the request if your request mappings blend into the URI space used by the repository.
|
||||
It will also apply the following extra functionality to the controller methods:
|
||||
|
||||
. CORS configuration according as defined for the repository mapped to the base path segment used in the request mapping of the handler method.
|
||||
. Apply an `OpenEntityManagerInViewInterceptor` if JPA is used to make sure you can access properties marked as to be resolved lazily.
|
||||
|
||||
WARNING: If you use `@Controller` or `@RestController` for anything, that code is totally outside the scope of Spring Data REST. This extends to request handling, message converters, exception handling, and other uses.
|
||||
|
||||
Reference in New Issue
Block a user