Skip to content

Commit a5dcbf0

Browse files
Update links in reference documentation.
We now use the springDocsUrl attribute provided via spring-projects/spring-data-build#1895 to resolve links to framework documentation. Original Pull Request: #4267
1 parent c312035 commit a5dcbf0

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

src/main/asciidoc/preface.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ This section provides some basic introduction to Spring and Document databases.
1010
[[get-started:first-steps:spring]]
1111
== Learning Spring
1212

13-
Spring Data uses Spring framework's https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/core.html[core] functionality, including:
13+
Spring Data uses Spring framework's link:{springDocsUrl}/core.html[core] functionality, including:
1414

15-
* https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/core.html#beans[IoC] container
16-
* https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/core.html#validation[type conversion system]
17-
* https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/core.html#expressions[expression language]
18-
* https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/integration.html#jmx[JMX integration]
19-
* https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/data-access.html#dao-exceptions[DAO exception hierarchy].
15+
* link:{springDocsUrl}/core.html#beans[IoC] container
16+
* link:{springDocsUrl}/core.html#validation[type conversion system]
17+
* link:{springDocsUrl}/core.html#expressions[expression language]
18+
* link:{springDocsUrl}/integration.html#jmx[JMX integration]
19+
* link:{springDocsUrl}/data-access.html#dao-exceptions[DAO exception hierarchy].
2020

2121
While you need not know the Spring APIs, understanding the concepts behind them is important. At a minimum, the idea behind Inversion of Control (IoC) should be familiar, and you should be familiar with whatever IoC container you choose to use.
2222

src/main/asciidoc/reference/client-session-transactions.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ CAUTION: Changing state of `MongoTemplate` during runtime (as you might think wo
177177
[[mongo.transactions.tx-manager]]
178178
== Transactions with `MongoTransactionManager`
179179

180-
`MongoTransactionManager` is the gateway to the well known Spring transaction support. It lets applications use https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/data-access.html#transaction[the managed transaction features of Spring].
180+
`MongoTransactionManager` is the gateway to the well known Spring transaction support. It lets applications use link:{springDocsUrl}/data-access.html#transaction[the managed transaction features of Spring].
181181
The `MongoTransactionManager` binds a `ClientSession` to the thread. `MongoTemplate` detects the session and operates on these resources which are associated with the transaction accordingly. `MongoTemplate` can also participate in other, ongoing transactions. The following example shows how to create and use transactions with a `MongoTransactionManager`:
182182

183183
.Transactions with `MongoTransactionManager`

src/main/asciidoc/reference/jmx.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[mongo.jmx]]
22
= JMX support
33

4-
The JMX support for MongoDB exposes the results of running the 'serverStatus' command on the admin database for a single MongoDB server instance. It also exposes an administrative MBean, `MongoAdmin`, that lets you perform administrative operations, such as dropping or creating a database. The JMX features build upon the JMX feature set available in the Spring Framework. See https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/integration.html#jmx[here] for more details.
4+
The JMX support for MongoDB exposes the results of running the 'serverStatus' command on the admin database for a single MongoDB server instance. It also exposes an administrative MBean, `MongoAdmin`, that lets you perform administrative operations, such as dropping or creating a database. The JMX features build upon the JMX feature set available in the Spring Framework. See link:{springDocsUrl}/integration.html#jmx[here] for more details.
55

66
[[mongodb:jmx-configuration]]
77
== MongoDB JMX Configuration

src/main/asciidoc/reference/mongo-custom-conversions.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The snippet above is handy for providing simple type hints. To gain more fine-gr
4040

4141
The `MappingMongoConverter` checks to see if any Spring converters can handle a specific class before attempting to map the object itself. To 'hijack' the normal mapping strategies of the `MappingMongoConverter`, perhaps for increased performance or other custom mapping needs, you first need to create an implementation of the Spring `Converter` interface and then register it with the `MappingConverter`.
4242

43-
NOTE: For more information on the Spring type conversion service, see the reference docs https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/core.html#validation[here].
43+
NOTE: For more information on the Spring type conversion service, see the reference docs link:{springDocsUrl}/core.html#validation[here].
4444

4545
[[mongo.custom-converters.writer]]
4646
=== Saving by Using a Registered Spring Converter

src/main/asciidoc/reference/mongo-repositories-aggregation.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
The repository layer offers means to interact with <<mongo.aggregation, the aggregation framework>> via annotated repository query methods.
55
Similar to the <<mongodb.repositories.queries.json-based, JSON based queries>>, you can define a pipeline using the `org.springframework.data.mongodb.repository.Aggregation` annotation.
6-
The definition may contain simple placeholders like `?0` as well as https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/core.html#expressions[SpEL expressions] `?#{ … }`.
6+
The definition may contain simple placeholders like `?0` as well as link:{springDocsUrl}/core.html#expressions[SpEL expressions] `?#{ … }`.
77

88
.Aggregating Repository Method
99
====

src/main/asciidoc/reference/mongodb.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public class AppConfig {
191191
----
192192
====
193193

194-
This approach lets you use the standard `com.mongodb.client.MongoClient` instance, with the container using Spring's `MongoClientFactoryBean`. As compared to instantiating a `com.mongodb.client.MongoClient` instance directly, the `FactoryBean` has the added advantage of also providing the container with an `ExceptionTranslator` implementation that translates MongoDB exceptions to exceptions in Spring's portable `DataAccessException` hierarchy for data access classes annotated with the `@Repository` annotation. This hierarchy and the use of `@Repository` is described in https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/data-access.html[Spring's DAO support features].
194+
This approach lets you use the standard `com.mongodb.client.MongoClient` instance, with the container using Spring's `MongoClientFactoryBean`. As compared to instantiating a `com.mongodb.client.MongoClient` instance directly, the `FactoryBean` has the added advantage of also providing the container with an `ExceptionTranslator` implementation that translates MongoDB exceptions to exceptions in Spring's portable `DataAccessException` hierarchy for data access classes annotated with the `@Repository` annotation. This hierarchy and the use of `@Repository` is described in link:{springDocsUrl}/data-access.html[Spring's DAO support features].
195195

196196
The following example shows an example of a Java-based bean metadata that supports exception translation on `@Repository` annotated classes:
197197

@@ -2258,7 +2258,7 @@ Therefore a given `Query` will be rewritten for `count` operations using `Reacti
22582258

22592259
You can query MongoDB by using Map-Reduce, which is useful for batch processing, for data aggregation, and for when the query language does not fulfill your needs.
22602260

2261-
Spring provides integration with MongoDB's Map-Reduce by providing methods on `MongoOperations` to simplify the creation and running of Map-Reduce operations.It can convert the results of a Map-Reduce operation to a POJO and integrates with Spring's https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/core.html#resources[Resource abstraction].This lets you place your JavaScript files on the file system, classpath, HTTP server, or any other Spring Resource implementation and then reference the JavaScript resources through an easy URI style syntax -- for example, `classpath:reduce.js;`.Externalizing JavaScript code in files is often preferable to embedding them as Java strings in your code.Note that you can still pass JavaScript code as Java strings if you prefer.
2261+
Spring provides integration with MongoDB's Map-Reduce by providing methods on `MongoOperations` to simplify the creation and running of Map-Reduce operations.It can convert the results of a Map-Reduce operation to a POJO and integrates with Spring's link:{springDocsUrl}/core.html#resources[Resource abstraction].This lets you place your JavaScript files on the file system, classpath, HTTP server, or any other Spring Resource implementation and then reference the JavaScript resources through an easy URI style syntax -- for example, `classpath:reduce.js;`.Externalizing JavaScript code in files is often preferable to embedding them as Java strings in your code.Note that you can still pass JavaScript code as Java strings if you prefer.
22622262

22632263
[[mongo.mapreduce.example]]
22642264
=== Example Usage
@@ -2664,7 +2664,7 @@ include::./mongo-entity-callbacks.adoc[leveloffset=+2]
26642664

26652665
The Spring framework provides exception translation for a wide variety of database and mapping technologies. This has traditionally been for JDBC and JPA. The Spring support for MongoDB extends this feature to the MongoDB Database by providing an implementation of the `org.springframework.dao.support.PersistenceExceptionTranslator` interface.
26662666

2667-
The motivation behind mapping to Spring's https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/data-access.html#dao-exceptions[consistent data access exception hierarchy] is that you are then able to write portable and descriptive exception handling code without resorting to coding against MongoDB error codes. All of Spring's data access exceptions are inherited from the root `DataAccessException` class so that you can be sure to catch all database related exception within a single try-catch block. Note that not all exceptions thrown by the MongoDB driver inherit from the `MongoException` class. The inner exception and message are preserved so that no information is lost.
2667+
The motivation behind mapping to Spring's link:{springDocsUrl}/data-access.html#dao-exceptions[consistent data access exception hierarchy] is that you are then able to write portable and descriptive exception handling code without resorting to coding against MongoDB error codes. All of Spring's data access exceptions are inherited from the root `DataAccessException` class so that you can be sure to catch all database related exception within a single try-catch block. Note that not all exceptions thrown by the MongoDB driver inherit from the `MongoException` class. The inner exception and message are preserved so that no information is lost.
26682668

26692669
Some of the mappings performed by the `MongoExceptionTranslator` are `com.mongodb.Network to DataAccessResourceFailureException` and `MongoException` error codes 1003, 12001, 12010, 12011, and 12012 to `InvalidDataAccessApiUsageException`. Look into the implementation for more details on the mapping.
26702670

src/main/asciidoc/reference/reactive-mongodb.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public class AppConfig {
164164

165165
This approach lets you use the standard `com.mongodb.reactivestreams.client.MongoClient` API (which you may already know).
166166

167-
An alternative is to register an instance of `com.mongodb.reactivestreams.client.MongoClient` instance with the container by using Spring's `ReactiveMongoClientFactoryBean`. As compared to instantiating a `com.mongodb.reactivestreams.client.MongoClient` instance directly, the `FactoryBean` approach has the added advantage of also providing the container with an `ExceptionTranslator` implementation that translates MongoDB exceptions to exceptions in Spring's portable `DataAccessException` hierarchy for data access classes annotated with the `@Repository` annotation. This hierarchy and use of `@Repository` is described in https://docs.spring.io/spring-framework/docs/{springVersion}/reference/html/data-access.html[Spring's DAO support features].
167+
An alternative is to register an instance of `com.mongodb.reactivestreams.client.MongoClient` instance with the container by using Spring's `ReactiveMongoClientFactoryBean`. As compared to instantiating a `com.mongodb.reactivestreams.client.MongoClient` instance directly, the `FactoryBean` approach has the added advantage of also providing the container with an `ExceptionTranslator` implementation that translates MongoDB exceptions to exceptions in Spring's portable `DataAccessException` hierarchy for data access classes annotated with the `@Repository` annotation. This hierarchy and use of `@Repository` is described in link:{springDocsUrl}/data-access.html[Spring's DAO support features].
168168

169169
The following example shows Java-based bean metadata that supports exception translation on `@Repository` annotated classes:
170170

0 commit comments

Comments
 (0)