From 1a8e9c14b1e6233a33f76f359dce10213ee0f176 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 26 Jul 2024 16:20:09 +0100 Subject: [PATCH] Fix "Use Spring Data repositories" how-to to refer to interfaces The previous how-to accidentally referenced the `@Repository` annotation and not the Spring Data `Repository` interface. Closes gh-41625 --- .../src/docs/asciidoc/howto/data-access.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-access.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-access.adoc index ddff627d958..8568eed283f 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-access.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-access.adoc @@ -149,14 +149,14 @@ Note that each `configuration` sub namespace provides advanced settings based on [[howto.data-access.spring-data-repositories]] === Use Spring Data Repositories -Spring Data can create implementations of `@Repository` interfaces of various flavors. -Spring Boot handles all of that for you, as long as those `@Repository` annotations are included in one of the <>, typically the package (or a sub-package) of your main application class that is annotated with `@SpringBootApplication` or `@EnableAutoConfiguration`. +Spring Data can create implementations of `Repository` interfaces of various flavors. +Spring Boot handles all of that for you, as long as those `Repository` implementations are included in one of the <>, typically the package (or a sub-package) of your main application class that is annotated with `@SpringBootApplication` or `@EnableAutoConfiguration`. For many applications, all you need is to put the right Spring Data dependencies on your classpath. There is a `spring-boot-starter-data-jpa` for JPA, `spring-boot-starter-data-mongodb` for Mongodb, and various other starters for supported technologies. To get started, create some repository interfaces to handle your `@Entity` objects. -Spring Boot determines the location of your `@Repository` definitions by scanning the <>. +Spring Boot determines the location of your `Repository` implementations by scanning the <>. For more control, use the `@Enable…Repositories` annotations from Spring Data. For more about Spring Data, see the {spring-data}[Spring Data project page].