#368 - Polishing.

Line breaks after dots in ascii doctor file for easier reading of the source files.
Adds specific deprecation links instead of just links to the general package.
Removes an unused private method in `ConnectionFactoryUtils`

Original pull request: #412.
This commit is contained in:
Jens Schauder
2020-08-04 14:55:42 +02:00
committed by Mark Paluch
parent 3d59c63bc0
commit b0e03ea3a3
40 changed files with 69 additions and 52 deletions

View File

@@ -11,7 +11,8 @@ Spring Data R2DBC was developed with the intent to evaluate how well R2DBC can i
One of the main aspects was to move core support into Spring Framework once R2DBC support has proven useful.
Spring Framework 5.3 ships with a new module: Spring R2DBC (`spring-r2dbc`).
`spring-r2dbc` ships core R2DBC functionality (a slim variant of `DatabaseClient`, Transaction Manager, Connection Factory initialization, Exception translation) that was initially provided by Spring Data R2DBC. The 1.2.0 release aligns with what's provided in Spring R2DBC by making several changes outlined in the following sections.
`spring-r2dbc` ships core R2DBC functionality (a slim variant of `DatabaseClient`, Transaction Manager, Connection Factory initialization, Exception translation) that was initially provided by Spring Data R2DBC.
The 1.2.0 release aligns with what's provided in Spring R2DBC by making several changes outlined in the following sections.
Spring R2DBC's `DatabaseClient` is a more lightweight implementation that encapsulates a pure SQL-oriented interface.
You will notice that the method to run SQL statements changed from `DatabaseClient.execute(…)` to `DatabaseClient.sql(…)`.
@@ -36,7 +37,8 @@ Spring R2DBC provides a slim exception translation variant without an SPI for no
[[upgrading.1.1-1.2.replacements]]
=== Usage of replacements provided by Spring R2DBC
To ease migration, several deprecated types are now subtypes of their replacements provided by Spring R2DBC. Spring Data R2DBC has changes several methods or introduced new methods accepting Spring R2DBC types.
To ease migration, several deprecated types are now subtypes of their replacements provided by Spring R2DBC.
Spring Data R2DBC has changes several methods or introduced new methods accepting Spring R2DBC types.
Specifically the following classes are changed:
* `R2dbcEntityTemplate`

View File

@@ -36,7 +36,8 @@ import org.springframework.util.Assert;
*
* @author Mark Paluch
* @author Christoph Strobl
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.ConnectionFactoryUtils} instead.
*/
@Deprecated
public abstract class ConnectionFactoryUtils {
@@ -82,21 +83,6 @@ public abstract class ConnectionFactoryUtils {
return org.springframework.r2dbc.connection.ConnectionFactoryUtils.doGetConnection(connectionFactory);
}
/**
* Actually fetch a {@link io.r2dbc.spi.Connection} from the given {@link io.r2dbc.spi.ConnectionFactory}, defensively
* turning an unexpected {@literal null} return value from {@link io.r2dbc.spi.ConnectionFactory#create()} into an
* {@link IllegalStateException}.
*
* @param connectionFactory the {@link io.r2dbc.spi.ConnectionFactory} to obtain {@link io.r2dbc.spi.Connection}s from
* @return a R2DBC {@link io.r2dbc.spi.Connection} from the given {@link io.r2dbc.spi.ConnectionFactory} (never
* {@literal null}).
* @throws IllegalStateException if the {@link io.r2dbc.spi.ConnectionFactory} returned a {@literal null} value.
* @see ConnectionFactory#create()
*/
private static Mono<Connection> fetchConnection(ConnectionFactory connectionFactory) {
return Mono.from(connectionFactory.create());
}
/**
* Close the given {@link io.r2dbc.spi.Connection}, obtained from the given {@link io.r2dbc.spi.ConnectionFactory}, if
* it is not managed externally (that is, not bound to the thread).

View File

@@ -33,7 +33,8 @@ import org.springframework.util.Assert;
* @author Christoph Strobl
* @see R2dbcTransactionManager
* @see ConnectionFactoryUtils
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.ConnectionHolder}
* instead.
*/
@Deprecated
public class ConnectionHolder extends ResourceHolderSupport {

View File

@@ -32,7 +32,8 @@ import org.springframework.util.Assert;
*
* @author Mark Paluch
* @see #create
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.DelegatingConnectionFactory} instead.
*/
@Deprecated
public class DelegatingConnectionFactory implements ConnectionFactory, Wrapped<ConnectionFactory> {

View File

@@ -53,7 +53,8 @@ import org.springframework.util.Assert;
* @see #create()
* @see io.r2dbc.spi.Connection#close()
* @see ConnectionFactoryUtils#releaseConnection(io.r2dbc.spi.Connection, ConnectionFactory)
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.SingleConnectionFactory} instead.
*/
@Deprecated
public class SingleConnectionConnectionFactory extends DelegatingConnectionFactory

View File

@@ -60,7 +60,8 @@ import org.springframework.util.ReflectionUtils;
* @see Connection#close
* @see ConnectionFactoryUtils#doGetConnection
* @see ConnectionFactoryUtils#doReleaseConnection
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.TransactionAwareConnectionFactoryProxy} instead.
*/
@Deprecated
public class TransactionAwareConnectionFactoryProxy extends DelegatingConnectionFactory {

View File

@@ -21,7 +21,8 @@ import org.springframework.core.io.support.EncodedResource;
* Thrown by {@link ScriptUtils} if an SQL script cannot be read.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.init.CannotReadScriptException} instead.
*/
@Deprecated
public class CannotReadScriptException extends ScriptException {

View File

@@ -31,7 +31,8 @@ import org.springframework.util.Assert;
* executing all scripts.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.init.CompositeDatabasePopulator} instead.
*/
@Deprecated
public class CompositeDatabasePopulator implements DatabasePopulator {

View File

@@ -28,7 +28,8 @@ import org.springframework.util.Assert;
*
* @author Mark Paluch
* @see DatabasePopulator
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.init.ConnectionFactoryInitializer} instead.
*/
@Deprecated
public class ConnectionFactoryInitializer implements InitializingBean, DisposableBean {

View File

@@ -25,7 +25,8 @@ import reactor.core.publisher.Mono;
* @see ResourceDatabasePopulator
* @see DatabasePopulatorUtils
* @see ConnectionFactoryInitializer
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.init.DatabasePopulator} instead.
*/
@FunctionalInterface
@Deprecated

View File

@@ -45,7 +45,8 @@ import org.springframework.util.StringUtils;
* @author Mark Paluch
* @see DatabasePopulatorUtils
* @see ScriptUtils
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.init.ResourceDatabasePopulator} instead.
*/
@Deprecated
public class ResourceDatabasePopulator implements DatabasePopulator {

View File

@@ -22,7 +22,8 @@ import org.springframework.lang.Nullable;
* Root of the hierarchy of data access exceptions that are related to processing of SQL scripts.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init.ScriptException}
* instead.
*/
@Deprecated
public abstract class ScriptException extends DataAccessException {

View File

@@ -22,7 +22,8 @@ import org.springframework.lang.Nullable;
* Thrown by {@link ScriptUtils} if an SQL script cannot be properly parsed.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.init.ScriptParseException} instead.
*/
@Deprecated
public class ScriptParseException extends ScriptException {

View File

@@ -21,7 +21,8 @@ import org.springframework.core.io.support.EncodedResource;
* Thrown by {@link ScriptUtils} if a statement in an SQL script failed when executing it against the target database.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.init.ScriptStatementFailedException} instead.
*/
@Deprecated
public class ScriptStatementFailedException extends ScriptException {

View File

@@ -48,7 +48,8 @@ import org.springframework.util.StringUtils;
* Mainly for internal use within the framework.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init.ScriptUtils}
* instead.
*/
@Deprecated
public abstract class ScriptUtils {

View File

@@ -20,7 +20,8 @@ package org.springframework.data.r2dbc.connectionfactory.init;
* for example, a {@link io.r2dbc.spi.R2dbcException} from R2DBC that we cannot pinpoint more precisely.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.init} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.init.UncategorizedScriptException} instead.
*/
@Deprecated
public class UncategorizedScriptException extends ScriptException {

View File

@@ -42,7 +42,8 @@ import org.springframework.util.Assert;
* @see #setTargetConnectionFactories
* @see #setDefaultTargetConnectionFactory
* @see #determineCurrentLookupKey()
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.lookup} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.lookup.AbstractRoutingConnectionFactory} instead.
*/
@Deprecated
public abstract class AbstractRoutingConnectionFactory implements ConnectionFactory, InitializingBean {

View File

@@ -30,7 +30,8 @@ import org.springframework.util.Assert;
*
* @author Mark Paluch
* @see BeanFactory
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.lookup} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.lookup.BeanFactoryConnectionFactoryLookup} instead.
*/
@Deprecated
public class BeanFactoryConnectionFactoryLookup implements ConnectionFactoryLookup, BeanFactoryAware {

View File

@@ -21,7 +21,8 @@ import io.r2dbc.spi.ConnectionFactory;
* Strategy interface for looking up {@link ConnectionFactory} by name.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.lookup} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.lookup.ConnectionFactoryLookup} instead.
*/
@FunctionalInterface
@Deprecated

View File

@@ -22,7 +22,8 @@ import org.springframework.dao.NonTransientDataAccessException;
* {@link io.r2dbc.spi.ConnectionFactory} could not be obtained.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.lookup} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.lookup.ConnectionFactoryLookupFailureException} instead.
*/
@SuppressWarnings("serial")
@Deprecated

View File

@@ -31,7 +31,8 @@ import org.springframework.util.Assert;
*
* @author Mark Paluch
* @author Jens Schauder
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.lookup} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.lookup.MapConnectionFactoryLookup} instead.
*/
@Deprecated
public class MapConnectionFactoryLookup implements ConnectionFactoryLookup {

View File

@@ -24,7 +24,8 @@ import org.springframework.util.Assert;
* returned for any connection factory name.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection.lookup} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use
* {@link org.springframework.r2dbc.connection.lookup.SingleConnectionFactoryLookup} instead.
*/
@Deprecated
public class SingleConnectionFactoryLookup implements ConnectionFactoryLookup {

View File

@@ -32,7 +32,7 @@ import org.reactivestreams.Publisher;
* @author Mark Paluch
* @since 1.1
* @see Statement#execute()
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core} support instead.
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core.ExecuteFunction} support instead.
*/
@Deprecated
@FunctionalInterface

View File

@@ -22,7 +22,7 @@ package org.springframework.data.r2dbc.core;
* @author Mark Paluch
* @see RowsFetchSpec
* @see UpdatedRowsFetchSpec
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core} support instead.
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core.FetchSpec} support instead.
*/
@Deprecated
public interface FetchSpec<T> extends RowsFetchSpec<T>, UpdatedRowsFetchSpec {}

View File

@@ -30,6 +30,7 @@ import org.springframework.util.Assert;
* {@link NamedParameterExpander} class.
*
* @author Mark Paluch
* @deprecated since 1.2, use Spring's org.springframework.r2dbc.core.MapBindParameterSource support instead.
*/
@Deprecated
class MapBindParameterSource implements BindParameterSource {

View File

@@ -46,6 +46,7 @@ import org.springframework.util.Assert;
* @author Thomas Risberg
* @author Juergen Hoeller
* @author Mark Paluch
* @deprecated since 1.2, use Spring's org.springframework.r2dbc.core.NamedParameterUtils support instead.
*/
@Deprecated
abstract class NamedParameterUtils {

View File

@@ -25,6 +25,7 @@ import java.util.List;
*
* @author Thomas Risberg
* @author Juergen Hoeller
* @deprecated since 1.2, use Spring's org.springframework.r2dbc.core.ParsedSql support instead.
*/
@Deprecated
class ParsedSql {

View File

@@ -29,7 +29,7 @@ import org.springframework.data.r2dbc.dialect.BindTarget;
* @param <T> underlying operation source.
* @author Mark Paluch
* @see org.springframework.data.r2dbc.core.DatabaseClient#execute(Supplier)
* @deprecated since 1.2, use Spring R2DBC's {@link org.springframework.r2dbc.core} support instead.
* @deprecated since 1.2, use Spring R2DBC's {@link org.springframework.r2dbc.core.PreparedOperation} support instead.
*/
@Deprecated
public interface PreparedOperation<T> extends QueryOperation, org.springframework.r2dbc.core.PreparedOperation<T> {

View File

@@ -23,7 +23,7 @@ import java.util.function.Supplier;
*
* @author Mark Paluch
* @see PreparedOperation
* @deprecated since 1.2, use Spring R2DBC's {@link org.springframework.r2dbc.core} support instead.
* @deprecated since 1.2, use Spring R2DBC's {@link org.springframework.r2dbc.core.QueryOperation} support instead.
*/
@FunctionalInterface
@Deprecated

View File

@@ -23,7 +23,7 @@ import reactor.core.publisher.Mono;
*
* @param <T> row result type.
* @author Mark Paluch
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core} support instead.
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core.RowsFetchSpec} support instead.
*/
@Deprecated
public interface RowsFetchSpec<T> {

View File

@@ -25,7 +25,7 @@ import org.springframework.lang.Nullable;
*
* @author Juergen Hoeller
* @author Mark Paluch
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core} support instead.
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core.SqlProvider} support instead.
*/
@Deprecated
public interface SqlProvider extends org.springframework.r2dbc.core.SqlProvider {

View File

@@ -31,7 +31,7 @@ import org.springframework.util.Assert;
* @author Mark Paluch
* @since 1.1
* @see ExecuteFunction
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core} support instead.
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core.StatementFilterFunction} support instead.
*/
@Deprecated
@FunctionalInterface

View File

@@ -25,6 +25,7 @@ import org.reactivestreams.Publisher;
*
* @author Mark Paluch
* @since 1.1
* @deprecated since 1.2, use Spring's org.springframework.r2dbc.core.StatementFilterFunctions support instead.
*/
@Deprecated
enum StatementFilterFunctions implements StatementFilterFunction {

View File

@@ -21,7 +21,7 @@ import reactor.core.publisher.Mono;
* Contract for fetching the number of affected rows.
*
* @author Mark Paluch
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core} support instead.
* @deprecated since 1.2, use Spring's {@link org.springframework.r2dbc.core.UpdatedRowsFetchSpec} support instead.
*/
@Deprecated
public interface UpdatedRowsFetchSpec {

View File

@@ -10,7 +10,8 @@ import io.r2dbc.spi.Statement;
* @see Statement#bind
* @see BindMarkers
* @see BindMarkersFactory
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding.BindMarker}
* instead.
*/
@Deprecated
public interface BindMarker extends org.springframework.r2dbc.core.binding.BindMarker {

View File

@@ -12,7 +12,8 @@ package org.springframework.data.r2dbc.dialect;
* @see BindMarker
* @see BindMarkersFactory
* @see io.r2dbc.spi.Statement#bind
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding.BindMarkers}
* instead.
*/
@FunctionalInterface
@Deprecated

View File

@@ -15,7 +15,8 @@ import org.springframework.util.Assert;
* @author Mark Paluch
* @see BindMarkers
* @see io.r2dbc.spi.Statement
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding.BindMarkersFactory}
* instead.
*/
@FunctionalInterface
@Deprecated

View File

@@ -24,7 +24,8 @@ import org.springframework.data.r2dbc.core.PreparedOperation;
* @see PreparedOperation
* @see io.r2dbc.spi.Statement#bind
* @see io.r2dbc.spi.Statement#bindNull
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding.BindTarget}
* instead.
*/
@Deprecated
public interface BindTarget extends org.springframework.r2dbc.core.binding.BindTarget {

View File

@@ -39,7 +39,7 @@ import org.springframework.util.Assert;
* Bindings are typically immutable.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding.Bindings} instead.
*/
@Deprecated
public class Bindings implements Streamable<Bindings.Binding> {

View File

@@ -26,7 +26,8 @@ import org.springframework.util.Assert;
* {@link BindMarkers}.
*
* @author Mark Paluch
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding} instead.
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.core.binding.MutableBindings}
* instead.
*/
@Deprecated
public class MutableBindings extends Bindings {