Browse Source

Initial upgrade to R2DBC Borca

See gh-27976
pull/28011/head
Juergen Hoeller 3 years ago
parent
commit
e5af4aa608
  1. 2
      build.gradle
  2. 5
      spring-r2dbc/spring-r2dbc.gradle
  3. 3
      spring-r2dbc/src/main/java/org/springframework/r2dbc/core/ColumnMapRowMapper.java
  4. 12
      spring-r2dbc/src/test/java/org/springframework/r2dbc/core/DefaultDatabaseClientUnitTests.java

2
build.gradle

@ -30,7 +30,7 @@ configure(allprojects) { project -> @@ -30,7 +30,7 @@ configure(allprojects) { project ->
mavenBom "com.fasterxml.jackson:jackson-bom:2.13.1"
mavenBom "io.netty:netty-bom:4.1.73.Final"
mavenBom "io.projectreactor:reactor-bom:2020.0.15"
mavenBom "io.r2dbc:r2dbc-bom:Arabba-SR12"
mavenBom "io.r2dbc:r2dbc-bom:Borca-RELEASE"
mavenBom "io.rsocket:rsocket-bom:1.1.1"
mavenBom "org.eclipse.jetty:jetty-bom:11.0.7"
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.6.10"

5
spring-r2dbc/spring-r2dbc.gradle

@ -17,10 +17,7 @@ dependencies { @@ -17,10 +17,7 @@ dependencies {
testImplementation(testFixtures(project(":spring-context")))
testImplementation("io.projectreactor:reactor-test")
testImplementation("io.r2dbc:r2dbc-h2")
testImplementation("com.h2database:h2:1.4.200") {
because("r2dbc-h2 does not yet support H2 2.0")
}
testImplementation("io.r2dbc:r2dbc-spi-test:0.8.1.RELEASE") {
testImplementation("io.r2dbc:r2dbc-spi-test:0.9.1.RELEASE") {
exclude group: "org.springframework", module: "spring-jdbc"
}
}

3
spring-r2dbc/src/main/java/org/springframework/r2dbc/core/ColumnMapRowMapper.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -52,6 +52,7 @@ public class ColumnMapRowMapper implements BiFunction<Row, RowMetadata, Map<Stri @@ -52,6 +52,7 @@ public class ColumnMapRowMapper implements BiFunction<Row, RowMetadata, Map<Stri
public final static ColumnMapRowMapper INSTANCE = new ColumnMapRowMapper();
@SuppressWarnings("deprecation") // getColumnNames() is deprecated as of R2DBC 0.9
@Override
public Map<String, Object> apply(Row row, RowMetadata rowMetadata) {
Collection<String> columns = rowMetadata.getColumnNames();

12
spring-r2dbc/src/test/java/org/springframework/r2dbc/core/DefaultDatabaseClientUnitTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -247,7 +247,7 @@ class DefaultDatabaseClientUnitTests { @@ -247,7 +247,7 @@ class DefaultDatabaseClientUnitTests {
@Test
void selectShouldEmitFirstValue() {
MockRowMetadata metadata = MockRowMetadata.builder().columnMetadata(
MockColumnMetadata.builder().name("name").build()).build();
MockColumnMetadata.builder().name("name").javaType(String.class).build()).build();
MockResult.Builder resultBuilder = MockResult.builder().rowMetadata(metadata);
MockResult result = resultBuilder.row(MockRow.builder().identified(0, Object.class, "Walter").build())
@ -267,7 +267,7 @@ class DefaultDatabaseClientUnitTests { @@ -267,7 +267,7 @@ class DefaultDatabaseClientUnitTests {
@Test
void selectShouldEmitAllValues() {
MockRowMetadata metadata = MockRowMetadata.builder().columnMetadata(
MockColumnMetadata.builder().name("name").build()).build();
MockColumnMetadata.builder().name("name").javaType(String.class).build()).build();
MockResult.Builder resultBuilder = MockResult.builder().rowMetadata(metadata);
MockResult result = resultBuilder.row(MockRow.builder().identified(0, Object.class, "Walter").build())
@ -289,7 +289,7 @@ class DefaultDatabaseClientUnitTests { @@ -289,7 +289,7 @@ class DefaultDatabaseClientUnitTests {
void selectOneShouldFailWithException() {
MockRowMetadata metadata = MockRowMetadata.builder().columnMetadata(
MockColumnMetadata.builder().name("name").build()).build();
MockColumnMetadata.builder().name("name").javaType(String.class).build()).build();
MockResult.Builder resultBuilder = MockResult.builder().rowMetadata(metadata);
MockResult result = resultBuilder.row(MockRow.builder().identified(0, Object.class, "Walter").build())
@ -356,7 +356,7 @@ class DefaultDatabaseClientUnitTests { @@ -356,7 +356,7 @@ class DefaultDatabaseClientUnitTests {
void shouldApplyStatementFilterFunctions() {
MockRowMetadata metadata = MockRowMetadata.builder().columnMetadata(
MockColumnMetadata.builder().name("name").build()).build();
MockColumnMetadata.builder().name("name").javaType(String.class).build()).build();
MockResult result = MockResult.builder().rowMetadata(metadata).build();
Statement statement = mockStatement(result);
@ -434,7 +434,7 @@ class DefaultDatabaseClientUnitTests { @@ -434,7 +434,7 @@ class DefaultDatabaseClientUnitTests {
private MockResult mockSingleColumnResult(@Nullable MockRow.Builder row) {
MockRowMetadata metadata = MockRowMetadata.builder().columnMetadata(
MockColumnMetadata.builder().name("name").build()).build();
MockColumnMetadata.builder().name("name").javaType(String.class).build()).build();
MockResult.Builder resultBuilder = MockResult.builder().rowMetadata(metadata);
if (row != null) {

Loading…
Cancel
Save