Create spring-boot-data-r2dbc module

Issue: 46129
This commit is contained in:
Stéphane Nicoll 2025-03-28 17:17:27 +01:00 committed by Phillip Webb
parent 786aa20d8b
commit ab842a9701
20 changed files with 79 additions and 34 deletions

View File

@ -76,6 +76,7 @@ include "spring-boot-project:spring-boot-data-jpa"
include "spring-boot-project:spring-boot-data-ldap"
include "spring-boot-project:spring-boot-data-mongodb"
include "spring-boot-project:spring-boot-data-neo4j"
include "spring-boot-project:spring-boot-data-r2dbc"
include "spring-boot-project:spring-boot-data-redis"
include "spring-boot-project:spring-boot-dependencies"
include "spring-boot-project:spring-boot-devtools"

View File

@ -19,12 +19,6 @@
"description": "Whether to enable the PersistenceExceptionTranslationPostProcessor.",
"defaultValue": true
},
{
"name": "spring.data.r2dbc.repositories.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable R2DBC repositories.",
"defaultValue": true
},
{
"name": "spring.graphql.schema.file-extensions",
"defaultValue": ".graphqls,.gqls"

View File

@ -1,8 +1,6 @@
org.springframework.boot.autoconfigure.aop.AopAutoConfiguration
org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration
org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration
org.springframework.boot.autoconfigure.data.r2dbc.R2dbcDataAutoConfiguration
org.springframework.boot.autoconfigure.data.r2dbc.R2dbcRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration

View File

@ -0,0 +1,43 @@
/*
* Copyright 2012-present 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id "java-library"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.deployed"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot Data R2DBC"
dependencies {
api(project(":spring-boot-project:spring-boot-r2dbc"))
api("io.r2dbc:r2dbc-spi")
api("io.r2dbc:r2dbc-pool")
api("org.springframework.data:spring-data-r2dbc")
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
testImplementation("io.projectreactor:reactor-test")
testImplementation("io.r2dbc:r2dbc-h2")
testRuntimeOnly("ch.qos.logback:logback-classic")
}

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.r2dbc;
package org.springframework.boot.data.r2dbc.autoconfigure;
import java.util.ArrayList;
import java.util.Collections;
@ -49,7 +49,7 @@ import org.springframework.r2dbc.core.DatabaseClient;
*
* @author Mark Paluch
* @author Oliver Drotbohm
* @since 2.3.0
* @since 4.0.0
*/
@AutoConfiguration(after = R2dbcAutoConfiguration.class)
@ConditionalOnClass({ DatabaseClient.class, R2dbcEntityTemplate.class })

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.r2dbc;
package org.springframework.boot.data.r2dbc.autoconfigure;
import io.r2dbc.spi.ConnectionFactory;
@ -34,7 +34,7 @@ import org.springframework.r2dbc.core.DatabaseClient;
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data R2DBC Repositories.
*
* @author Mark Paluch
* @since 2.3.0
* @since 4.0.0
* @see EnableR2dbcRepositories
*/
@AutoConfiguration(after = R2dbcDataAutoConfiguration.class)

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.r2dbc;
package org.springframework.boot.data.r2dbc.autoconfigure;
import java.lang.annotation.Annotation;

View File

@ -17,4 +17,4 @@
/**
* Auto-Configuration for Spring Data R2DBC.
*/
package org.springframework.boot.autoconfigure.data.r2dbc;
package org.springframework.boot.data.r2dbc.autoconfigure;

View File

@ -0,0 +1,11 @@
{
"groups": [],
"properties": [
{
"name": "spring.data.r2dbc.repositories.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable R2DBC repositories.",
"defaultValue": true
}
]
}

View File

@ -0,0 +1,2 @@
org.springframework.boot.data.r2dbc.autoconfigure.R2dbcDataAutoConfiguration
org.springframework.boot.data.r2dbc.autoconfigure.R2dbcRepositoriesAutoConfiguration

View File

@ -14,13 +14,13 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.r2dbc;
package org.springframework.boot.data.r2dbc.autoconfigure;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.data.r2dbc.city.City;
import org.springframework.boot.data.r2dbc.domain.city.City;
import org.springframework.boot.r2dbc.autoconfigure.R2dbcAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.data.domain.ManagedTypes;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.r2dbc;
package org.springframework.boot.data.r2dbc.autoconfigure;
import java.time.Duration;
@ -25,9 +25,9 @@ import reactor.test.StepVerifier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.data.empty.EmptyDataPackage;
import org.springframework.boot.autoconfigure.data.r2dbc.city.City;
import org.springframework.boot.autoconfigure.data.r2dbc.city.CityRepository;
import org.springframework.boot.data.r2dbc.domain.city.City;
import org.springframework.boot.data.r2dbc.domain.city.CityRepository;
import org.springframework.boot.data.r2dbc.domain.empty.EmptyDataPackage;
import org.springframework.boot.r2dbc.autoconfigure.R2dbcAutoConfiguration;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.r2dbc.city;
package org.springframework.boot.data.r2dbc.domain.city;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.r2dbc.city;
package org.springframework.boot.data.r2dbc.domain.city;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;

View File

@ -14,13 +14,8 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.empty;
package org.springframework.boot.data.r2dbc.domain.empty;
/**
* Empty package used with data tests.
*
* @author Phillip Webb
*/
public class EmptyDataPackage {
}

View File

@ -2004,6 +2004,7 @@ bom {
"spring-boot-data-ldap",
"spring-boot-data-mongodb",
"spring-boot-data-neo4j",
"spring-boot-data-r2dbc",
"spring-boot-data-redis",
"spring-boot-devtools",
"spring-boot-docker-compose",

View File

@ -92,6 +92,7 @@ dependencies {
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-ldap", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-mongodb", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-neo4j", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-r2dbc", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-redis", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "autoConfigurationMetadata"))
@ -151,6 +152,7 @@ dependencies {
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-jpa", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-ldap", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-neo4j", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-r2dbc", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-redis", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata"))

View File

@ -22,9 +22,6 @@ description = "Starter for using Spring Data R2DBC"
dependencies {
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter"))
api(project(":spring-boot-project:spring-boot-r2dbc"))
api(project(":spring-boot-project:spring-boot-data-r2dbc"))
api(project(":spring-boot-project:spring-boot-tx"))
api("org.springframework.data:spring-data-r2dbc")
api("io.r2dbc:r2dbc-spi")
api("io.r2dbc:r2dbc-pool")
}

View File

@ -61,6 +61,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-data-ldap"))
optional(project(":spring-boot-project:spring-boot-data-mongodb"))
optional(project(":spring-boot-project:spring-boot-data-neo4j"))
optional(project(":spring-boot-project:spring-boot-data-r2dbc"))
optional(project(":spring-boot-project:spring-boot-data-redis"))
optional(project(":spring-boot-project:spring-boot-flyway"))
optional(project(":spring-boot-project:spring-boot-groovy-templates"))

View File

@ -1,6 +1,6 @@
# AutoConfigureDataR2dbc auto-configuration imports
org.springframework.boot.autoconfigure.data.r2dbc.R2dbcRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.r2dbc.R2dbcDataAutoConfiguration
org.springframework.boot.data.r2dbc.autoconfigure.R2dbcRepositoriesAutoConfiguration
org.springframework.boot.data.r2dbc.autoconfigure.R2dbcDataAutoConfiguration
org.springframework.boot.r2dbc.autoconfigure.R2dbcAutoConfiguration
org.springframework.boot.r2dbc.autoconfigure.R2dbcInitializationAutoConfiguration
org.springframework.boot.r2dbc.autoconfigure.R2dbcTransactionManagerAutoConfiguration