#2344 - Rename Database.getDataSource() to dataSource() with deprecation

This commit is contained in:
Rob Bygrave
2021-09-02 22:48:09 +12:00
parent 239a444d4c
commit 12c5e9ea5d
12 changed files with 33 additions and 18 deletions
@@ -27,7 +27,7 @@ public class SqlServerStepSequenceTest extends BaseTestCase {
server().sqlUpdate("create sequence sqls_testseq_9876 start with 1 increment by 50").execute();
BackgroundExecutor be = server().getBackgroundExecutor();
DataSource ds = server().getDataSource();
DataSource ds = server().dataSource();
SqlServerStepSequence s = new SqlServerStepSequence(be, ds, "sqls_testseq_9876", 50);
@@ -338,12 +338,12 @@ public class TDSpiEbeanServer implements SpiEbeanServer {
}
@Override
public DataSource getDataSource() {
public DataSource dataSource() {
return null;
}
@Override
public DataSource getReadOnlyDataSource() {
public DataSource readOnlyDataSource() {
return null;
}
@@ -266,7 +266,7 @@ public class TestRawSqlBuilder extends BaseTestCase {
"join o_customer c on o.kcustomer_id = c.id " +
"where c.id = ? and o.id > ?";
final DataSource dataSource = DB.getDefault().getDataSource();
final DataSource dataSource = DB.getDefault().dataSource();
try (Connection connection = dataSource.getConnection()) {
try (PreparedStatement stmt = connection.prepareStatement(sql)) {
+1 -1
View File
@@ -15,7 +15,7 @@ public class Main {
EbeanServer ms = Ebean.getServer("ms");
DataSource dataSource = ms.getDataSource();
DataSource dataSource = ms.dataSource();
Connection connection = dataSource.getConnection();
PreparedStatement statement = connection.prepareStatement("select next VALUE for j2_seq");
@@ -2,7 +2,6 @@ package org.tests.basic;
import io.ebean.BaseTestCase;
import io.ebean.DB;
import io.ebean.Database;
import io.ebean.Transaction;
import io.ebean.annotation.IgnorePlatform;
import io.ebean.annotation.Platform;
@@ -24,7 +23,7 @@ public class TestQueryUsingConnection extends BaseTestCase {
ResetBasicData.reset();
DataSource dataSource = DB.getDefault().getDataSource();
DataSource dataSource = DB.getDefault().dataSource();
try (Connection connection = dataSource.getConnection()) {
@@ -235,7 +235,7 @@ public class TestQueryFindIterate extends BaseTestCase {
SpiServer pluginApi = server().getPluginApi();
DataSourcePool dsPool = (DataSourcePool) pluginApi.getServerConfig().getReadOnlyDataSource();
if (dsPool == null) {
dsPool = (DataSourcePool) server().getDataSource();
dsPool = (DataSourcePool) server().dataSource();
}
int startConns = dsPool.getStatus(false).getBusy();