Skip to content

Commit f87ae36

Browse files
committed
Document restrictions of simple base-repository method overrides in regard to projections.
Closes #2473
1 parent 44db1dc commit f87ae36

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/main/asciidoc/repository-projections.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ interface PersonRepository extends Repository<Person, UUID> {
6969

7070
The query execution engine creates proxy instances of that interface at runtime for each element returned and forwards calls to the exposed methods to the target object.
7171

72+
NOTE: Declaring a method in your `Repository` that overrides a base method (e.g. declared in `CrudRepository`, a store-specific repository interface, or the `Simple…Repository`) results in a call to the base method regardless of the declared return type. Make sure to use a compatible return type as base methods cannot be used for projections. Some store modules support `@Query` annotations to turn an overridden base method into a query method that then can be used to return projections.
73+
7274
[[projections.interfaces.nested]]
7375
Projections can be used recursively. If you want to include some of the `Address` information as well, create a projection interface for that and return that interface from the declaration of `getAddress()`, as shown in the following example:
7476

0 commit comments

Comments
 (0)