diff --git a/src/main/java/org/springframework/data/r2dbc/function/DefaultDatabaseClient.java b/src/main/java/org/springframework/data/r2dbc/function/DefaultDatabaseClient.java index d158fb6..34c8e82 100644 --- a/src/main/java/org/springframework/data/r2dbc/function/DefaultDatabaseClient.java +++ b/src/main/java/org/springframework/data/r2dbc/function/DefaultDatabaseClient.java @@ -80,7 +80,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { private final DefaultDatabaseClientBuilder builder; DefaultDatabaseClient(ConnectionFactory connector, R2dbcExceptionTranslator exceptionTranslator, - ReactiveDataAccessStrategy dataAccessStrategy, DefaultDatabaseClientBuilder builder) { + ReactiveDataAccessStrategy dataAccessStrategy, DefaultDatabaseClientBuilder builder) { this.connector = connector; this.exceptionTranslator = exceptionTranslator; @@ -201,15 +201,15 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { */ protected Connection createConnectionProxy(Connection con) { return (Connection) Proxy.newProxyInstance(ConnectionProxy.class.getClassLoader(), - new Class[]{ConnectionProxy.class}, new CloseSuppressingInvocationHandler(con)); + new Class[] { ConnectionProxy.class }, new CloseSuppressingInvocationHandler(con)); } /** * Translate the given {@link R2dbcException} into a generic {@link DataAccessException}. * * @param task readable text describing the task being attempted. - * @param sql SQL query or update that caused the problem (may be {@literal null}). - * @param ex the offending {@link R2dbcException}. + * @param sql SQL query or update that caused the problem (may be {@literal null}). + * @param ex the offending {@link R2dbcException}. * @return a DataAccessException wrapping the {@link R2dbcException} (never {@literal null}). */ protected DataAccessException translateException(String task, @Nullable String sql, R2dbcException ex) { @@ -222,7 +222,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { * Customization hook. */ protected DefaultTypedExecuteSpec createTypedExecuteSpec(Map byIndex, - Map byName, Supplier sqlSupplier, Class typeToRead) { + Map byName, Supplier sqlSupplier, Class typeToRead) { return new DefaultTypedExecuteSpec<>(byIndex, byName, sqlSupplier, typeToRead); } @@ -230,8 +230,8 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { * Customization hook. */ protected DefaultTypedExecuteSpec createTypedExecuteSpec(Map byIndex, - Map byName, Supplier sqlSupplier, - BiFunction mappingFunction) { + Map byName, Supplier sqlSupplier, + BiFunction mappingFunction) { return new DefaultTypedExecuteSpec<>(byIndex, byName, sqlSupplier, mappingFunction); } @@ -239,7 +239,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { * Customization hook. */ protected ExecuteSpecSupport createGenericExecuteSpec(Map byIndex, - Map byName, Supplier sqlSupplier) { + Map byName, Supplier sqlSupplier) { return new DefaultGenericExecuteSpec(byIndex, byName, sqlSupplier); } @@ -251,7 +251,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { } private static void doBind(Statement statement, Map byName, - Map byIndex) { + Map byIndex) { byIndex.forEach((i, o) -> { @@ -377,7 +377,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { } protected ExecuteSpecSupport createInstance(Map byIndex, Map byName, - Supplier sqlSupplier) { + Supplier sqlSupplier) { return new ExecuteSpecSupport(byIndex, byName, sqlSupplier); } @@ -395,7 +395,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { protected class DefaultGenericExecuteSpec extends ExecuteSpecSupport implements GenericExecuteSpec { DefaultGenericExecuteSpec(Map byIndex, Map byName, - Supplier sqlSupplier) { + Supplier sqlSupplier) { super(byIndex, byName, sqlSupplier); } @@ -456,7 +456,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { @Override protected ExecuteSpecSupport createInstance(Map byIndex, Map byName, - Supplier sqlSupplier) { + Supplier sqlSupplier) { return createGenericExecuteSpec(byIndex, byName, sqlSupplier); } } @@ -471,7 +471,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { private final BiFunction mappingFunction; DefaultTypedExecuteSpec(Map byIndex, Map byName, - Supplier sqlSupplier, Class typeToRead) { + Supplier sqlSupplier, Class typeToRead) { super(byIndex, byName, sqlSupplier); @@ -480,7 +480,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { } DefaultTypedExecuteSpec(Map byIndex, Map byName, - Supplier sqlSupplier, BiFunction mappingFunction) { + Supplier sqlSupplier, BiFunction mappingFunction) { super(byIndex, byName, sqlSupplier); @@ -541,7 +541,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { @Override protected DefaultTypedExecuteSpec createInstance(Map byIndex, - Map byName, Supplier sqlSupplier) { + Map byName, Supplier sqlSupplier) { return createTypedExecuteSpec(byIndex, byName, sqlSupplier, typeToRead); } } @@ -628,7 +628,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { } protected abstract DefaultSelectSpecSupport createInstance(String table, List projectedFields, Sort sort, - Pageable page); + Pageable page); } private class DefaultGenericSelectSpec extends DefaultSelectSpecSupport implements GenericSelectSpec { @@ -695,7 +695,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { @Override protected DefaultGenericSelectSpec createInstance(String table, List projectedFields, Sort sort, - Pageable page) { + Pageable page) { return new DefaultGenericSelectSpec(table, projectedFields, sort, page); } } @@ -706,8 +706,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { @SuppressWarnings("unchecked") private class DefaultTypedSelectSpec extends DefaultSelectSpecSupport implements TypedSelectSpec { - private final @Nullable - Class typeToRead; + private final @Nullable Class typeToRead; private final BiFunction mappingFunction; DefaultTypedSelectSpec(Class typeToRead) { @@ -719,12 +718,12 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { } DefaultTypedSelectSpec(String table, List projectedFields, Sort sort, Pageable page, - BiFunction mappingFunction) { + BiFunction mappingFunction) { this(table, projectedFields, sort, page, null, mappingFunction); } DefaultTypedSelectSpec(String table, List projectedFields, Sort sort, Pageable page, Class typeToRead, - BiFunction mappingFunction) { + BiFunction mappingFunction) { super(table, projectedFields, sort, page); this.typeToRead = typeToRead; this.mappingFunction = mappingFunction; @@ -784,7 +783,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { @Override protected DefaultTypedSelectSpec createInstance(String table, List projectedFields, Sort sort, - Pageable page) { + Pageable page) { return new DefaultTypedSelectSpec<>(table, projectedFields, sort, page, typeToRead, mappingFunction); } } @@ -1022,8 +1021,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { } catch (R2dbcException e) { String sql = getSql(action); - return Flux.error(new UncategorizedR2dbcException("doInConnectionMany", sql, e) { - }); + return Flux.error(new UncategorizedR2dbcException("doInConnectionMany", sql, e)); } } @@ -1034,8 +1032,7 @@ class DefaultDatabaseClient implements DatabaseClient, ConnectionAccessor { } catch (R2dbcException e) { String sql = getSql(action); - return Mono.error(new UncategorizedR2dbcException("doInConnection", sql, e) { - }); + return Mono.error(new UncategorizedR2dbcException("doInConnection", sql, e)); } }