You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/antora/modules/ROOT/pages/customizing/overriding-sdr-response-handlers.adoc
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ The following example shows how to use the `@RepositoryRestController` annotatio
9
9
====
10
10
[source,java]
11
11
----
12
-
@BasePathAwareController
12
+
@RepositoryRestController
13
13
class ScannerController {
14
14
15
15
private final ScannerRepository repository;
@@ -47,7 +47,7 @@ class ScannerController {
47
47
48
48
`CollectionModel` is for a collection, while `EntityModel` -- or the more general class `RepresentationModel` -- is for a single item. These types can be combined. If you know the links for each item in a collection, use `CollectionModel<EntityModel<String>>` (or whatever the core domain type is rather than `String`). Doing so lets you assemble links for each item as well as for the whole collection.
49
49
50
-
IMPORTANT: In this example, the combined path is `RepositoryRestConfiguration.getBasePath()` + `/scanners/search/listProducers`.
50
+
IMPORTANT: In this example, the combined path is `RepositoryRestConfiguration.getBasePath()` + `/scanners/search/producers`.
51
51
52
52
[[customizing-sdr.aggregate-references]]
53
53
== Obtaining Aggregate References
@@ -60,7 +60,7 @@ All you need to do is declare an `@RequestParam` of that type and then consume e
60
60
61
61
[source,java]
62
62
----
63
-
@BasePathAwareController
63
+
@RepositoryRestController
64
64
class ScannerController {
65
65
66
66
private final ScannerRepository repository;
@@ -93,7 +93,7 @@ In case you are using jMolecules, `AssociationAggregateReference` also allows yo
93
93
While both of the abstraction assume the value for the parameter to be a URI matching the scheme that Spring Data REST uses to expose item resources, that source value resolution can be customized by calling `….withIdSource(…)` on the reference instance to provide a function to extract the identifier value to be used for aggregate resolution eventually from the `UriComponents` obtained from the URI received.
== `@RepositoryRestResource` VS. `@BasePathAwareController`
96
+
== `@RepositoryRestController` VS. `@BasePathAwareController`
97
97
98
98
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`.
99
99
If you're using `@RepositoryRestController` on your custom controller, it will only handle the request if your request mappings blend into the URI space used by the repository.
0 commit comments