Create spring-boot-data-jdbc module

This commit is contained in:
Stéphane Nicoll 2025-03-28 16:27:46 +01:00 committed by Andy Wilkinson
parent f046d5c5db
commit 062a5766d7
20 changed files with 80 additions and 25 deletions

View File

@ -55,6 +55,7 @@ include "spring-boot-project:spring-boot-couchbase"
include "spring-boot-project:spring-boot-data-cassandra"
include "spring-boot-project:spring-boot-data-couchbase"
include "spring-boot-project:spring-boot-data-elasticsearch"
include "spring-boot-project:spring-boot-data-jdbc"
include "spring-boot-project:spring-boot-data-jpa"
include "spring-boot-project:spring-boot-data-ldap"
include "spring-boot-project:spring-boot-data-mongodb"

View File

@ -19,12 +19,6 @@
"description": "Whether to enable the PersistenceExceptionTranslationPostProcessor.",
"defaultValue": true
},
{
"name": "spring.data.jdbc.repositories.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable JDBC repositories.",
"defaultValue": true
},
{
"name": "spring.data.r2dbc.repositories.enabled",
"type": "java.lang.Boolean",

View File

@ -1,7 +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.jdbc.JdbcRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.r2dbc.R2dbcDataAutoConfiguration
org.springframework.boot.autoconfigure.data.r2dbc.R2dbcRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration

View File

@ -0,0 +1,24 @@
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 JDBC"
dependencies {
api(project(":spring-boot-project:spring-boot-jdbc"))
api("org.springframework.data:spring-data-jdbc")
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")))
testRuntimeOnly("ch.qos.logback:logback-classic")
testRuntimeOnly("com.h2database:h2")
testRuntimeOnly("com.zaxxer:HikariCP")
}

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.jdbc;
package org.springframework.boot.data.jdbc.autoconfigure;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.jdbc;
package org.springframework.boot.data.jdbc.autoconfigure;
import org.springframework.data.jdbc.core.dialect.JdbcDb2Dialect;
import org.springframework.data.jdbc.core.dialect.JdbcMySqlDialect;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.jdbc;
package org.springframework.boot.data.jdbc.autoconfigure;
import java.util.Optional;
import java.util.Set;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.jdbc;
package org.springframework.boot.data.jdbc.autoconfigure;
import java.lang.annotation.Annotation;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2025 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.
@ -17,4 +17,4 @@
/**
* Auto-configuration for Spring Data JDBC.
*/
package org.springframework.boot.autoconfigure.data.jdbc;
package org.springframework.boot.data.jdbc.autoconfigure;

View File

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

View File

@ -0,0 +1 @@
org.springframework.boot.data.jdbc.autoconfigure.JdbcRepositoriesAutoConfiguration

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.jdbc;
package org.springframework.boot.data.jdbc.autoconfigure;
import java.util.function.Function;
@ -25,9 +25,9 @@ import org.mockito.Answers;
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.jdbc.city.City;
import org.springframework.boot.autoconfigure.data.jdbc.city.CityRepository;
import org.springframework.boot.data.jdbc.domain.city.City;
import org.springframework.boot.data.jdbc.domain.city.CityRepository;
import org.springframework.boot.data.jdbc.domain.empty.EmptyDataPackage;
import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration;
import org.springframework.boot.jdbc.autoconfigure.DataSourceInitializationAutoConfiguration;
import org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2025 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.jdbc.city;
package org.springframework.boot.data.jdbc.domain.city;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2025 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.jdbc.city;
package org.springframework.boot.data.jdbc.domain.city;
import org.springframework.data.repository.CrudRepository;

View File

@ -0,0 +1,21 @@
/*
* Copyright 2012-2025 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.
*/
package org.springframework.boot.data.jdbc.domain.empty;
public class EmptyDataPackage {
}

View File

@ -2028,6 +2028,7 @@ bom {
"spring-boot-data-cassandra",
"spring-boot-data-couchbase",
"spring-boot-data-elasticsearch",
"spring-boot-data-jdbc",
"spring-boot-data-jpa",
"spring-boot-data-ldap",
"spring-boot-data-mongodb",

View File

@ -65,6 +65,7 @@ dependencies {
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-cassandra", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-couchbase", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-elasticsearch", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-jdbc", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-jpa", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-ldap", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-mongodb", configuration: "autoConfigurationMetadata"))
@ -124,6 +125,7 @@ dependencies {
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-cassandra", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-couchbase", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-elasticsearch", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-jdbc", configuration: "configurationPropertiesMetadata"))
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"))

View File

@ -6,5 +6,5 @@ description = "Starter for using Spring Data JDBC"
dependencies {
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc"))
api("org.springframework.data:spring-data-jdbc")
api(project(":spring-boot-project:spring-boot-data-jdbc"))
}

View File

@ -39,6 +39,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-data-cassandra"))
optional(project(":spring-boot-project:spring-boot-data-couchbase"))
optional(project(":spring-boot-project:spring-boot-data-elasticsearch"))
optional(project(":spring-boot-project:spring-boot-data-jdbc"))
optional(project(":spring-boot-project:spring-boot-data-jpa"))
optional(project(":spring-boot-project:spring-boot-data-ldap"))
optional(project(":spring-boot-project:spring-boot-data-mongodb"))

View File

@ -1,5 +1,5 @@
# AutoConfigureDataJdbc auto-configuration imports
org.springframework.boot.autoconfigure.data.jdbc.JdbcRepositoriesAutoConfiguration
org.springframework.boot.data.jdbc.autoconfigure.JdbcRepositoriesAutoConfiguration
org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration
org.springframework.boot.jdbc.autoconfigure.DataSourceInitializationAutoConfiguration
org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration