@@ -181,9 +181,9 @@ interface TestRepository extends CrudRepository<TestEntity, Long> { // <.>
181181
182182 List<ExtendedTestEntity> findAllExtendedEntities(); // <.>
183183
184- List<TestEntityInterfaceProjection> findAllInterfaceProjections (); // <.>
184+ List<TestEntityInterfaceProjection> findAllInterfaceProjectionsBy (); // <.>
185185
186- List<TestEntityDTOProjection> findAllDTOProjections (); // <.>
186+ List<TestEntityDTOProjection> findAllDTOProjectionsBy (); // <.>
187187
188188 @Query("MATCH (t:TestEntity) - [r:RELATED_TO] -> () RETURN t, COUNT(r) AS numberOfRelations") // <.>
189189 List<TestEntityDTOProjection> findAllDTOProjectionsWithCustomQuery();
@@ -195,13 +195,15 @@ interface TestRepository extends CrudRepository<TestEntity, Long> { // <.>
195195 of the extending class. The domain type of the method in question will be the extended class, which
196196 still satisfies the domain type of the repository itself
197197<.> This method returns an interface projection, the return type of the method is therefore different
198- from the repository's domain type. The interface can only access properties defined in the domain type
198+ from the repository's domain type. The interface can only access properties defined in the domain type.
199+ The suffix `By` is needed to make SDN not look for a property called `InterfaceProjections` in the `TestEntity`
199200<.> This method returns a DTO projection. Executing it will cause SDN to issue a warning, as the DTO defines
200201 `numberOfRelations` as additional attribute, which is not in the contract of the domain type.
201202 The annotated attribute `aProperty` in `TestEntity` will be correctly translated to `a_property` in the query.
202203 As above, the return type is different from the repositories' domain type.
204+ The suffix `By` is needed to make SDN not look for a property called `DTOProjections` in the `TestEntity`
203205<.> This method also returns a DTO projection. However, no warning will be issued, as the query contains a fitting
204- value for the additional attributes defined in the projection.
206+ value for the additional attributes defined in the projection
205207
206208TIP: While the repository in <<projections.simple-entity-repository,the listing above>> uses a concrete return type to
207209 define the projection, another variant is the use of <<projection.dynamic,dynamic projections>> as explained in the
0 commit comments