Skip to content

Commit 1a75690

Browse files
committed
Fix 'spring.datasource.name' property description
Closes gh-27026
1 parent a76e5c0 commit 1a75690

File tree

1 file changed

+14
-13
lines changed
  • spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc

1 file changed

+14
-13
lines changed

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,14 +53,15 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
5353
private ClassLoader classLoader;
5454

5555
/**
56-
* Name of the datasource. Default to "testdb" when using an embedded database.
56+
* Whether to generate a random datasource name.
5757
*/
58-
private String name;
58+
private boolean generateUniqueName = true;
5959

6060
/**
61-
* Whether to generate a random datasource name.
61+
* Datasource name to use if "generate-unique-name" is false. Defaults to "testdb"
62+
* when using an embedded database, otherwise null.
6263
*/
63-
private boolean generateUniqueName = true;
64+
private String name;
6465

6566
/**
6667
* Fully qualified name of the connection pool implementation to use. By default, it
@@ -177,14 +178,6 @@ public DataSourceBuilder<?> initializeDataSourceBuilder() {
177178
.url(determineUrl()).username(determineUsername()).password(determinePassword());
178179
}
179180

180-
public String getName() {
181-
return this.name;
182-
}
183-
184-
public void setName(String name) {
185-
this.name = name;
186-
}
187-
188181
public boolean isGenerateUniqueName() {
189182
return this.generateUniqueName;
190183
}
@@ -193,6 +186,14 @@ public void setGenerateUniqueName(boolean generateUniqueName) {
193186
this.generateUniqueName = generateUniqueName;
194187
}
195188

189+
public String getName() {
190+
return this.name;
191+
}
192+
193+
public void setName(String name) {
194+
this.name = name;
195+
}
196+
196197
public Class<? extends DataSource> getType() {
197198
return this.type;
198199
}

0 commit comments

Comments
 (0)