Skip to content

Commit

Permalink
#368 - Polishing.
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
schauder committed Jul 24, 2020
1 parent 7707b4f commit b915038
Show file tree
Hide file tree
Showing 40 changed files with 43 additions and 52 deletions.
6 changes: 4 additions & 2 deletions src/main/asciidoc/reference/r2dbc-upgrading.adoc
Expand Up @@ -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` 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(…)`.
Expand All @@ -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 affected:

* `R2dbcEntityTemplate`
Expand Down
Expand Up @@ -36,7 +36,7 @@
*
* @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 {
Expand Down Expand Up @@ -82,21 +82,6 @@ public static Mono<Connection> doGetConnection(ConnectionFactory connectionFacto
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).
Expand Down
Expand Up @@ -33,7 +33,7 @@
* @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 {
Expand Down
Expand Up @@ -32,7 +32,7 @@
*
* @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> {
Expand Down
Expand Up @@ -53,7 +53,7 @@
* @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
Expand Down
Expand Up @@ -60,7 +60,7 @@
* @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 {
Expand Down
Expand Up @@ -21,7 +21,7 @@
* 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 {
Expand Down
Expand Up @@ -31,7 +31,7 @@
* 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 {
Expand Down
Expand Up @@ -28,7 +28,7 @@
*
* @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 {
Expand Down
Expand Up @@ -25,7 +25,7 @@
* @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
Expand Down
Expand Up @@ -45,7 +45,7 @@
* @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 {
Expand Down
Expand Up @@ -22,7 +22,7 @@
* 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 {
Expand Down
Expand Up @@ -22,7 +22,7 @@
* 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 {
Expand Down
Expand Up @@ -21,7 +21,7 @@
* 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 {
Expand Down
Expand Up @@ -48,7 +48,7 @@
* 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 {
Expand Down
Expand Up @@ -20,7 +20,7 @@
* 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 {
Expand Down
Expand Up @@ -42,7 +42,7 @@
* @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 {
Expand Down
Expand Up @@ -30,7 +30,7 @@
*
* @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 {
Expand Down
Expand Up @@ -21,7 +21,7 @@
* 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
Expand Down
Expand Up @@ -22,7 +22,7 @@
* {@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
Expand Down
Expand Up @@ -31,7 +31,7 @@
*
* @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 {
Expand Down
Expand Up @@ -24,7 +24,7 @@
* 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 {
Expand Down
Expand Up @@ -32,7 +32,7 @@
* @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
Expand Down
Expand Up @@ -22,7 +22,7 @@
* @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 {}
Expand Up @@ -30,6 +30,7 @@
* {@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 {
Expand Down
Expand Up @@ -46,6 +46,7 @@
* @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 {
Expand Down
Expand Up @@ -25,6 +25,7 @@
*
* @author Thomas Risberg
* @author Juergen Hoeller
* @deprecated since 1.2, use Spring's org.springframework.r2dbc.core.ParsedSql support instead.
*/
@Deprecated
class ParsedSql {
Expand Down
Expand Up @@ -29,7 +29,7 @@
* @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> {
Expand Down
Expand Up @@ -23,7 +23,7 @@
*
* @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
Expand Down
Expand Up @@ -23,7 +23,7 @@
*
* @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> {
Expand Down
Expand Up @@ -25,7 +25,7 @@
*
* @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 {
Expand Down
Expand Up @@ -31,7 +31,7 @@
* @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
Expand Down
Expand Up @@ -25,6 +25,7 @@
*
* @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 {
Expand Down
Expand Up @@ -21,7 +21,7 @@
* 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 {
Expand Down
Expand Up @@ -10,7 +10,7 @@
* @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 {
Expand Down
Expand Up @@ -12,7 +12,7 @@
* @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
Expand Down
Expand Up @@ -15,7 +15,7 @@
* @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
Expand Down
Expand Up @@ -24,7 +24,7 @@
* @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 {
Expand Down
Expand Up @@ -39,7 +39,7 @@
* 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> {
Expand Down
Expand Up @@ -26,7 +26,7 @@
* {@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 {
Expand Down

0 comments on commit b915038

Please sign in to comment.