Skip to content

Commit 52eaa7f

Browse files
committed
Revert "Merge pull request #39941 from schauder"
This reverts commit ab5dee8, reversing changes made to 2422307.
1 parent ab5dee8 commit 52eaa7f

File tree

3 files changed

+1
-68
lines changed

3 files changed

+1
-68
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcDataProperties.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesAutoConfiguration.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.Optional;
2020
import java.util.Set;
2121

22-
import org.springframework.beans.BeanUtils;
2322
import org.springframework.boot.autoconfigure.AutoConfiguration;
2423
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2524
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
@@ -29,7 +28,6 @@
2928
import org.springframework.boot.autoconfigure.domain.EntityScanner;
3029
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
3130
import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration;
32-
import org.springframework.boot.context.properties.EnableConfigurationProperties;
3331
import org.springframework.context.ApplicationContext;
3432
import org.springframework.context.annotation.Bean;
3533
import org.springframework.context.annotation.Configuration;
@@ -61,7 +59,6 @@
6159
* @author Andy Wilkinson
6260
* @author Stephane Nicoll
6361
* @author Mark Paluch
64-
* @author Jens Schauder
6562
* @since 2.1.0
6663
* @see EnableJdbcRepositories
6764
*/
@@ -70,7 +67,6 @@
7067
@ConditionalOnClass({ NamedParameterJdbcOperations.class, AbstractJdbcConfiguration.class })
7168
@ConditionalOnProperty(prefix = "spring.data.jdbc.repositories", name = "enabled", havingValue = "true",
7269
matchIfMissing = true)
73-
@EnableConfigurationProperties(JdbcDataProperties.class)
7470
public class JdbcRepositoriesAutoConfiguration {
7571

7672
@Configuration(proxyBeanMethods = false)
@@ -86,11 +82,8 @@ static class SpringBootJdbcConfiguration extends AbstractJdbcConfiguration {
8682

8783
private final ApplicationContext applicationContext;
8884

89-
private final JdbcDataProperties properties;
90-
91-
SpringBootJdbcConfiguration(ApplicationContext applicationContext, JdbcDataProperties properties) {
85+
SpringBootJdbcConfiguration(ApplicationContext applicationContext) {
9286
this.applicationContext = applicationContext;
93-
this.properties = properties;
9487
}
9588

9689
@Override
@@ -148,9 +141,6 @@ public DataAccessStrategy dataAccessStrategyBean(NamedParameterJdbcOperations op
148141
@Bean
149142
@ConditionalOnMissingBean
150143
public Dialect jdbcDialect(NamedParameterJdbcOperations operations) {
151-
if (this.properties.getDialect() != null) {
152-
return BeanUtils.instantiateClass(this.properties.getDialect(), Dialect.class);
153-
}
154144
return super.jdbcDialect(operations);
155145
}
156146

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesAutoConfigurationTests.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import org.springframework.data.jdbc.core.convert.DataAccessStrategy;
4141
import org.springframework.data.jdbc.core.convert.JdbcConverter;
4242
import org.springframework.data.jdbc.core.convert.JdbcCustomConversions;
43-
import org.springframework.data.jdbc.core.dialect.JdbcPostgresDialect;
4443
import org.springframework.data.jdbc.core.mapping.JdbcMappingContext;
4544
import org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration;
4645
import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories;
@@ -59,7 +58,6 @@
5958
* @author Andy Wilkinson
6059
* @author Stephane Nicoll
6160
* @author Mark Paluch
62-
* @author Jens Schauder
6361
*/
6462
class JdbcRepositoriesAutoConfigurationTests {
6563

@@ -183,16 +181,6 @@ void allowsUserToDefineCustomDialect() {
183181
allowsUserToDefineCustomBean(DialectConfiguration.class, Dialect.class, "customDialect");
184182
}
185183

186-
@Test
187-
void allowsConfigurationOfDialectByProperty() {
188-
this.contextRunner.with(database())
189-
.withPropertyValues("spring.data.jdbc.dialect:" + JdbcPostgresDialect.class.getName())
190-
.withConfiguration(AutoConfigurations.of(JdbcTemplateAutoConfiguration.class,
191-
DataSourceTransactionManagerAutoConfiguration.class))
192-
.withUserConfiguration(TestConfiguration.class)
193-
.run((context) -> assertThat(context).hasSingleBean(JdbcPostgresDialect.class));
194-
}
195-
196184
private void allowsUserToDefineCustomBean(Class<?> configuration, Class<?> beanType, String beanName) {
197185
this.contextRunner.with(database())
198186
.withConfiguration(AutoConfigurations.of(JdbcTemplateAutoConfiguration.class,

0 commit comments

Comments
 (0)