Fix to return DataSourceBuilder.Settings for getDataSourceConfig() and getReadOnlyDataSourceConfig()

That is, existing code using DataSourceConfig has access to the getter
methods of DataSourceConfig. The DataSourceBuilder interface only has
the setter methods and DataSourceBuilder.Settings has both getters and
setter methods.

That is, the refactor to extract the DataSourceBuilder interface also
split off the getter methods to the DataSourceBuilder.Settings interface
(because most of the time when using the builder we only need the
setter methods and effectively hiding the getter methods behind the settings()
is useful to simplify the API for users).
This commit is contained in:
Rob Bygrave
2023-11-06 12:14:27 +13:00
parent bcf7bd17be
commit 5b0a3607f6
7 changed files with 53 additions and 25 deletions
@@ -71,11 +71,11 @@ public class AutoConfigureForTesting implements AutoConfigure {
}
}
private void makeV1Compatible(DataSourceBuilder ds) {
private void makeV1Compatible(DataSourceBuilder.Settings ds) {
if (ds == null) {
return;
}
String url = ds.settings().getUrl();
String url = ds.getUrl();
if (url == null || !url.startsWith("jdbc:h2:")) {
return;
}