From 9f6cf4061c91a28bb343b8613719fae6bb5c2e82 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 22 May 2019 17:00:08 +0200 Subject: [PATCH] #104 - Polishing. Fix documentation links. Use variables for links to Spring Framework reference docs. Original pull request: #127. --- src/main/asciidoc/index.adoc | 1 + src/main/asciidoc/preface.adoc | 12 ++++++------ src/main/asciidoc/reference/r2dbc-core.adoc | 2 +- src/main/asciidoc/reference/r2dbc-transactions.adoc | 4 ++-- .../data/r2dbc/convert/ColumnMapRowMapper.java | 4 ++-- .../data/r2dbc/core/TransactionalDatabaseClient.java | 3 ++- .../data/r2dbc/dialect/BindMarker.java | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc index 34f5487b..da046a13 100644 --- a/src/main/asciidoc/index.adoc +++ b/src/main/asciidoc/index.adoc @@ -5,6 +5,7 @@ ifdef::backend-epub3[:front-cover-image: image:epub-cover.png[Front Cover,1050,1600]] :spring-data-commons-docs: ../../../../spring-data-commons/src/main/asciidoc :spring-data-r2dbc-javadoc: https://docs.spring.io/spring-data/r2dbc/docs/{version}/api +:spring-framework-ref: https://docs.spring.io/spring/docs/{springVersion}/spring-framework-reference :reactiveStreamsJavadoc: https://www.reactive-streams.org/reactive-streams-{reactiveStreamsVersion}-javadoc (C) 2018-2019 The original authors. diff --git a/src/main/asciidoc/preface.adoc b/src/main/asciidoc/preface.adoc index 670d109a..c0b72d2a 100644 --- a/src/main/asciidoc/preface.adoc +++ b/src/main/asciidoc/preface.adoc @@ -11,13 +11,13 @@ This section provides some basic introduction to Spring and databases. [[get-started:first-steps:spring]] == Learning Spring -Spring Data uses Spring framework's https://docs.spring.io/spring/docs/{springVersion}/spring-framework-reference/core.html[core] functionality, including: +Spring Data uses Spring framework's {spring-framework-ref}/core.html[core] functionality, including: -* https://docs.spring.io/spring/docs/{springVersion}/spring-framework-reference/core.html#beans[IoC] container -* https://docs.spring.io/spring/docs/{springVersion}/spring-framework-reference/core.html#validation[type conversion system] -* https://docs.spring.io/spring/docs/{springVersion}/spring-framework-reference/core.html#expressions[expression language] -* https://docs.spring.io/spring/docs/{springVersion}/spring-framework-reference/integration.html#jmx[JMX integration] -* https://docs.spring.io/spring/docs/{springVersion}/spring-framework-reference/data-access.html#dao-exceptions[DAO exception hierarchy]. +* {spring-framework-ref}/core.html#beans[IoC] container +* {spring-framework-ref}/core.html#validation[type conversion system] +* {spring-framework-ref}/core.html#expressions[expression language] +* {spring-framework-ref}/integration.html#jmx[JMX integration] +* {spring-framework-ref}/data-access.html#dao-exceptions[DAO exception hierarchy]. 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. diff --git a/src/main/asciidoc/reference/r2dbc-core.adoc b/src/main/asciidoc/reference/r2dbc-core.adoc index 5a704aa1..318fcd56 100644 --- a/src/main/asciidoc/reference/r2dbc-core.adoc +++ b/src/main/asciidoc/reference/r2dbc-core.adoc @@ -219,7 +219,7 @@ public class ApplicationConfiguration extends AbstractR2dbcConfiguration { ---- ==== -This approach lets you use the standard `io.r2dbc.spi.ConnectionFactory` instance, with the container using Spring's `AbstractR2dbcConfiguration`. As compared to registering a `ConnectionFactory` instance directly, the configuration support has the added advantage of also providing the container with an `ExceptionTranslator` implementation that translates R2DBC 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/docs/{springVersion}/spring-framework-reference/data-access.html[Spring's DAO support features]. +This approach lets you use the standard `io.r2dbc.spi.ConnectionFactory` instance, with the container using Spring's `AbstractR2dbcConfiguration`. As compared to registering a `ConnectionFactory` instance directly, the configuration support has the added advantage of also providing the container with an `ExceptionTranslator` implementation that translates R2DBC 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 {spring-framework-ref}/data-access.html[Spring's DAO support features]. `AbstractR2dbcConfiguration` registers also `DatabaseClient` that is required for database interaction and for Repository implementation. diff --git a/src/main/asciidoc/reference/r2dbc-transactions.adoc b/src/main/asciidoc/reference/r2dbc-transactions.adoc index e1d2cfc9..1b2087ac 100644 --- a/src/main/asciidoc/reference/r2dbc-transactions.adoc +++ b/src/main/asciidoc/reference/r2dbc-transactions.adoc @@ -5,7 +5,7 @@ A common pattern when using relational databases is grouping multiple queries wi Relational databases typically associate a transaction with a single transport connection. Using different connections hence results in utilizing different transactions. Spring Data R2DBC includes transaction-awareness in `DatabaseClient` that allows you to group multiple statements within -the same transaction using https://docs.spring.io/spring/docs/current/spring-framework-reference/data-access.html#transaction[Spring's Transaction Management]. +the same transaction using {spring-framework-ref}/data-access.html#transaction[Spring's Transaction Management]. Spring Data R2DBC provides a implementation for `ReactiveTransactionManager` with `R2dbcTransactionManager`. See <> for further details. @@ -35,7 +35,7 @@ Mono atomicOperation = client.sql("INSERT INTO person (id, name, age) VALU <2> Bind the operation to the `TransactionalOperator`. ==== -https://docs.spring.io/spring/docs/current/spring-framework-reference/data-access.html#transaction-declarative[Spring's declarative Transaction Management] +{spring-framework-ref}/data-access.html#transaction-declarative[Spring's declarative Transaction Management] is a less invasive, annotation-based approach to transaction demarcation. .Declarative Transaction Management diff --git a/src/main/java/org/springframework/data/r2dbc/convert/ColumnMapRowMapper.java b/src/main/java/org/springframework/data/r2dbc/convert/ColumnMapRowMapper.java index 3997d023..4ce484bb 100644 --- a/src/main/java/org/springframework/data/r2dbc/convert/ColumnMapRowMapper.java +++ b/src/main/java/org/springframework/data/r2dbc/convert/ColumnMapRowMapper.java @@ -27,8 +27,8 @@ import org.springframework.lang.Nullable; import org.springframework.util.LinkedCaseInsensitiveMap; /** - * {@link RowMapper} implementation that creates a {@link Map} for each row, representing all columns as key-value - * pairs: one entry for each column, with the column name as key. + * {@link BiFunction Mapping function} implementation that creates a {@link Map} for each row, representing all columns + * as key-value pairs: one entry for each column, with the column name as key. *

* The {@link Map} implementation to use and the key to use for each column in the column Map can be customized through * overriding {@link #createColumnMap} and {@link #getColumnKey}, respectively. diff --git a/src/main/java/org/springframework/data/r2dbc/core/TransactionalDatabaseClient.java b/src/main/java/org/springframework/data/r2dbc/core/TransactionalDatabaseClient.java index fd3334c3..439e3acb 100644 --- a/src/main/java/org/springframework/data/r2dbc/core/TransactionalDatabaseClient.java +++ b/src/main/java/org/springframework/data/r2dbc/core/TransactionalDatabaseClient.java @@ -33,7 +33,8 @@ import org.springframework.util.Assert; * transaction. Alternatively, transactions can be started and cleaned up using {@link #beginTransaction()} and * {@link #commitTransaction()}. *

- * Transactional resources are bound to {@link ReactiveTransactionSynchronization} through nested + * Transactional resources are bound to + * {@link org.springframework.data.r2dbc.connectionfactory.ReactiveTransactionSynchronization} through nested * {@link TransactionContext} enabling nested (parallel) transactions. The simplemost approach to use transactions is by * using {@link #inTransaction(Function)} which will start a transaction and commit it on successful termination. The * callback allows execution of multiple statements within the same transaction. diff --git a/src/main/java/org/springframework/data/r2dbc/dialect/BindMarker.java b/src/main/java/org/springframework/data/r2dbc/dialect/BindMarker.java index 1afa700c..66240521 100644 --- a/src/main/java/org/springframework/data/r2dbc/dialect/BindMarker.java +++ b/src/main/java/org/springframework/data/r2dbc/dialect/BindMarker.java @@ -24,7 +24,7 @@ public interface BindMarker { * Bind the given {@code value} to the {@link Statement} using the underlying binding strategy. * * @param bindTarget the target to bind the value to. - * @param value the actual value. Must not be {@literal null}. Use {@link #bindNull(Statement, Class)} for + * @param value the actual value. Must not be {@literal null}. Use {@link #bindNull(BindTarget, Class)} for * {@literal null} values. * @see Statement#bind */