mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
#2344 - Rename Database.getDataSource() to dataSource() with deprecation
This commit is contained in:
1 parent
239a444d4c
commit
12c5e9ea5d
12 files changed
+33
-18
No files matched your search
@@ -102,7 +102,7 @@ final class DScriptRunner implements ScriptRunner {
|
||||
|
||||
private Connection obtainConnection() {
|
||||
try {
|
||||
return server.getDataSource().getConnection();
|
||||
return server.dataSource().getConnection();
|
||||
} catch (SQLException e) {
|
||||
throw new PersistenceException("Failed to obtain connection to run script", e);
|
||||
}
|
||||
|
||||
@@ -355,12 +355,12 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSource getDataSource() {
|
||||
public DataSource dataSource() {
|
||||
return transactionManager.getDataSource();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSource getReadOnlyDataSource() {
|
||||
public DataSource readOnlyDataSource() {
|
||||
return transactionManager.getReadOnlyDataSource();
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
@Override
|
||||
public void truncate(String... tables) {
|
||||
try (Connection connection = getDataSource().getConnection()) {
|
||||
try (Connection connection = dataSource().getConnection()) {
|
||||
for (String table : tables) {
|
||||
executeSql(connection, databasePlatform.truncateStatement(table));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user