diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 55ac7dfa15..5afe60df24 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -181,6 +181,7 @@ content into your application; rather pick only the properties that you need. spring.data.mongodb.host= # the db host spring.data.mongodb.port=27017 # the connection port (defaults to 27107) spring.data.mongodb.uri=mongodb://localhost/test # connection URL + spring.data.mongo.repositories.enabled=true # if spring data repository support is enabled # JPA ({sc-spring-boot-autoconfigure}/orm/jpa/JpaBaseConfiguration.{sc-ext}[JpaBaseConfiguration], {sc-spring-boot-autoconfigure}/orm/jpa/HibernateJpaAutoConfiguration.{sc-ext}[HibernateJpaAutoConfiguration]) spring.jpa.properties.*= # properties to set on the JPA connection @@ -191,15 +192,20 @@ content into your application; rather pick only the properties that you need. spring.jpa.generate-ddl=false # ignored by Hibernate, might be useful for other vendors spring.jpa.hibernate.naming-strategy= # naming classname spring.jpa.hibernate.ddl-auto= # defaults to create-drop for embedded dbs + spring.data.jpa.repositories.enabled=true # if spring data repository support is enabled # SOLR ({sc-spring-boot-autoconfigure}/solr/SolrProperties.{sc-ext}[SolrProperties}]) spring.data.solr.host=http://127.0.0.1:8983/solr spring.data.solr.zkHost= + spring.data.solr.repositories.enabled=true # if spring data repository support is enabled # ELASTICSEARCH ({sc-spring-boot-autoconfigure}/elasticsearch/ElasticsearchProperties.{sc-ext}[ElasticsearchProperties}]) spring.data.elasticsearch.cluster-name= # The cluster name (defaults to elasticsearch) spring.data.elasticsearch.cluster-node= # The address(es) of the server node (comma-separated; if not specified starts a client node) spring.data.elasticsearch.local=true # if local mode should be used with client nodes + spring.data.elasticsearch.repositories.enabled=true # if spring data repository support is enabled + + # FLYWAY ({sc-spring-boot-autoconfigure}/flyway/FlywayProperties.{sc-ext}[FlywayProperties]) flyway.locations=classpath:db/migrations # locations of migrations scripts diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index f1cfb19826..336ddf3651 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -1115,26 +1115,27 @@ See https://github.com/spring-projects/spring-boot/blob/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java[`JpaBaseConfiguration`] for the default settings. + + [[howto-use-spring-data-jpa--and-mongo-repositories]] -=== Use Spring Data JPA and Mongo repositories +=== Use Spring Data JPA and Mongo repositories -Spring Data JPA and Spring Data Mongo can both create `Repository` -implementations for you automatically. If they are both present on the -classpath, you might have to do some extra configuration to tell -Spring Boot which one (or both) you want to create repositories for -you. The most explicit way to do that is to use the standard Spring -Data `@Enable*Repositories` and tell it the location of your -`Repository` interfaces (where "*" is "Jpa" or "Mongo" or both). +Spring Data JPA and Spring Data Mongo can both create `Repository` implementations for you +automatically. If they are both present on the classpath, you might have to do some extra +configuration to tell Spring Boot which one (or both) you want to create repositories for +you. The most explicit way to do that is to use the standard Spring Data +`@Enable*Repositories` and tell it the location of your `Repository` interfaces +(where ``*'' is ``Jpa'' or ``Mongo'' or both). -There are also flags `spring.data.*.repositories.enabled` that you can -use to switch the autoconfigured repositories on and off in external -configuration. This is useful for instance in case you want to switch -off the Mongo repositories and still use the autoconfigured -`MongoTemplate`. +There are also flags `spring.data.*.repositories.enabled` that you can use to switch the +auto-configured repositories on and off in external configuration. This is useful for +instance in case you want to switch off the Mongo repositories and still use the +auto-configured `MongoTemplate`. + +The same obstacle and the same features exist for other auto-configured Spring Data +repository types (Elasticsearch, Solr). Just change the names of the annotations and flags +respectively. -The same obstacle and the same features exist for other autoconfigured -Spring Data repository types (Elasticsearch, Solr). Just change the -names of the annotations and flags respectively. [[howto-database-initialization]]