mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#2359 - Rename Transaction.getConnection() method to connection() with deprecation
This commit is contained in:
@@ -318,8 +318,8 @@ public abstract class SpiTransactionProxy implements SpiTransaction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection() {
|
||||
return transaction.getConnection();
|
||||
public Connection connection() {
|
||||
return transaction.connection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -148,7 +148,7 @@ public final class InsertHandler extends DmlHandler {
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rset = null;
|
||||
try {
|
||||
stmt = transaction.getConnection().prepareStatement(persistRequest.getSelectLastInsertedId());
|
||||
stmt = transaction.connection().prepareStatement(persistRequest.getSelectLastInsertedId());
|
||||
rset = stmt.executeQuery();
|
||||
setGeneratedKey(rset);
|
||||
} finally {
|
||||
|
||||
@@ -409,7 +409,7 @@ final class CQueryBuilder {
|
||||
}
|
||||
query.setGeneratedSql(sql);
|
||||
|
||||
Connection connection = request.transaction().getConnection();
|
||||
Connection connection = request.transaction().connection();
|
||||
|
||||
BeanDescriptor<?> desc = request.descriptor();
|
||||
try {
|
||||
|
||||
@@ -132,7 +132,7 @@ public final class CQueryEngine {
|
||||
t.logSummary(msg);
|
||||
}
|
||||
// ensure 'rollback' is logged if queryOnly transaction
|
||||
t.getConnection();
|
||||
t.connection();
|
||||
// build a decent error message for the exception
|
||||
String m = "Query threw SQLException:" + e.getMessage() + " Bind values:[" + bindLog + "] Query was:" + sql;
|
||||
return dbPlatform.translate(m, e);
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public final class DocStoreOnlyTransaction extends JdbcTransaction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection() {
|
||||
public Connection connection() {
|
||||
throw new RuntimeException("not supported on DocStoreTransaction");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -503,7 +503,7 @@ final class ImplicitReadOnlyTransaction implements SpiTransaction, TxnProfileEve
|
||||
* Return the underlying connection for public use.
|
||||
*/
|
||||
@Override
|
||||
public Connection getConnection() {
|
||||
public Connection connection() {
|
||||
return getInternalConnection();
|
||||
}
|
||||
|
||||
|
||||
@@ -886,7 +886,7 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
* Return the underlying connection for public use.
|
||||
*/
|
||||
@Override
|
||||
public Connection getConnection() {
|
||||
public Connection connection() {
|
||||
queryOnly = false;
|
||||
return getInternalConnection();
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ final class NoTransaction implements SpiTransaction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection() {
|
||||
public Connection connection() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ abstract class TransactionFactory {
|
||||
*/
|
||||
final SpiTransaction setIsolationLevel(SpiTransaction t, boolean explicit, int isolationLevel) {
|
||||
if (isolationLevel > -1) {
|
||||
Connection connection = t.getConnection();
|
||||
Connection connection = t.connection();
|
||||
try {
|
||||
connection.setTransactionIsolation(isolationLevel);
|
||||
} catch (SQLException e) {
|
||||
|
||||
Reference in New Issue
Block a user