Skip to content

Commit 21029d2

Browse files
author
Phillip Webb
committed
Polish disable repository documentation
1 parent dcb17a7 commit 21029d2

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ content into your application; rather pick only the properties that you need.
181181
spring.data.mongodb.host= # the db host
182182
spring.data.mongodb.port=27017 # the connection port (defaults to 27107)
183183
spring.data.mongodb.uri=mongodb://localhost/test # connection URL
184+
spring.data.mongo.repositories.enabled=true # if spring data repository support is enabled
184185
185186
# JPA ({sc-spring-boot-autoconfigure}/orm/jpa/JpaBaseConfiguration.{sc-ext}[JpaBaseConfiguration], {sc-spring-boot-autoconfigure}/orm/jpa/HibernateJpaAutoConfiguration.{sc-ext}[HibernateJpaAutoConfiguration])
186187
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.
191192
spring.jpa.generate-ddl=false # ignored by Hibernate, might be useful for other vendors
192193
spring.jpa.hibernate.naming-strategy= # naming classname
193194
spring.jpa.hibernate.ddl-auto= # defaults to create-drop for embedded dbs
195+
spring.data.jpa.repositories.enabled=true # if spring data repository support is enabled
194196
195197
# SOLR ({sc-spring-boot-autoconfigure}/solr/SolrProperties.{sc-ext}[SolrProperties}])
196198
spring.data.solr.host=http://127.0.0.1:8983/solr
197199
spring.data.solr.zkHost=
200+
spring.data.solr.repositories.enabled=true # if spring data repository support is enabled
198201
199202
# ELASTICSEARCH ({sc-spring-boot-autoconfigure}/elasticsearch/ElasticsearchProperties.{sc-ext}[ElasticsearchProperties}])
200203
spring.data.elasticsearch.cluster-name= # The cluster name (defaults to elasticsearch)
201204
spring.data.elasticsearch.cluster-node= # The address(es) of the server node (comma-separated; if not specified starts a client node)
202205
spring.data.elasticsearch.local=true # if local mode should be used with client nodes
206+
spring.data.elasticsearch.repositories.enabled=true # if spring data repository support is enabled
207+
208+
203209
204210
# FLYWAY ({sc-spring-boot-autoconfigure}/flyway/FlywayProperties.{sc-ext}[FlywayProperties])
205211
flyway.locations=classpath:db/migrations # locations of migrations scripts

spring-boot-docs/src/main/asciidoc/howto.adoc

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,26 +1115,27 @@ See
11151115
https://github.com/spring-projects/spring-boot/blob/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java[`JpaBaseConfiguration`]
11161116
for the default settings.
11171117

1118+
1119+
11181120
[[howto-use-spring-data-jpa--and-mongo-repositories]]
1119-
=== Use Spring Data JPA and Mongo repositories
1120-
1121-
Spring Data JPA and Spring Data Mongo can both create `Repository`
1122-
implementations for you automatically. If they are both present on the
1123-
classpath, you might have to do some extra configuration to tell
1124-
Spring Boot which one (or both) you want to create repositories for
1125-
you. The most explicit way to do that is to use the standard Spring
1126-
Data `@Enable*Repositories` and tell it the location of your
1127-
`Repository` interfaces (where "*" is "Jpa" or "Mongo" or both).
1128-
1129-
There are also flags `spring.data.*.repositories.enabled` that you can
1130-
use to switch the autoconfigured repositories on and off in external
1131-
configuration. This is useful for instance in case you want to switch
1132-
off the Mongo repositories and still use the autoconfigured
1133-
`MongoTemplate`.
1134-
1135-
The same obstacle and the same features exist for other autoconfigured
1136-
Spring Data repository types (Elasticsearch, Solr). Just change the
1137-
names of the annotations and flags respectively.
1121+
=== Use Spring Data JPA and Mongo repositories
1122+
1123+
Spring Data JPA and Spring Data Mongo can both create `Repository` implementations for you
1124+
automatically. If they are both present on the classpath, you might have to do some extra
1125+
configuration to tell Spring Boot which one (or both) you want to create repositories for
1126+
you. The most explicit way to do that is to use the standard Spring Data
1127+
`@Enable*Repositories` and tell it the location of your `Repository` interfaces
1128+
(where ``*'' is ``Jpa'' or ``Mongo'' or both).
1129+
1130+
There are also flags `spring.data.*.repositories.enabled` that you can use to switch the
1131+
auto-configured repositories on and off in external configuration. This is useful for
1132+
instance in case you want to switch off the Mongo repositories and still use the
1133+
auto-configured `MongoTemplate`.
1134+
1135+
The same obstacle and the same features exist for other auto-configured Spring Data
1136+
repository types (Elasticsearch, Solr). Just change the names of the annotations and flags
1137+
respectively.
1138+
11381139

11391140

11401141
[[howto-database-initialization]]

0 commit comments

Comments
 (0)