#376 - Refactor - Remove PstmtDelegate ... that was used to access the underlying oracle specific PreparedStatement

This commit is contained in:
Robin Bygrave
2015-08-06 23:03:25 +12:00
parent e6f779268a
commit 0612d89e9a
5 changed files with 0 additions and 80 deletions
@@ -1,24 +0,0 @@
package com.avaje.ebean.config;
import java.sql.PreparedStatement;
/**
* Unwrap the PreparedStatement to get the specific underlying implementation.
* <p>
* This is used to handle specific JDBC driver issues. Typically this means
* getting the OraclePreparedStatement to handle Oracle specific issues etc.
* </p>
*
* @author rbygrave
*/
public interface PstmtDelegate {
/**
* Unwrap the PreparedStatement to get the specific underlying implementation.
*
* @param pstmt
* the PreparedStatement coming out of the connection pool
* @return the underlying PreparedStatement
*/
PreparedStatement unwrap(PreparedStatement pstmt);
}
@@ -198,11 +198,6 @@ public class ServerConfig {
private ExternalTransactionManager externalTransactionManager;
/**
* Used to unwrap PreparedStatements to perform JDBC Driver specific functions
*/
private PstmtDelegate pstmtDelegate;
/**
* The data source (if programmatically provided).
*/
private DataSource dataSource;
@@ -975,24 +970,6 @@ public class ServerConfig {
this.autofetchConfig = autofetchConfig;
}
/**
* Return the PreparedStatementDelegate.
*/
public PstmtDelegate getPstmtDelegate() {
return pstmtDelegate;
}
/**
* Set the PstmtDelegate which can be used to support JDBC driver specific
* features.
* <p>
* Typically this means Oracle JDBC driver specific workarounds.
* </p>
*/
public void setPstmtDelegate(PstmtDelegate pstmtDelegate) {
this.pstmtDelegate = pstmtDelegate;
}
/**
* Return the DataSource.
*/
@@ -8,7 +8,6 @@ import com.avaje.ebean.common.SpiContainer;
import com.avaje.ebean.config.ContainerConfig;
import com.avaje.ebean.config.DataSourceConfig;
import com.avaje.ebean.config.PropertyMap;
import com.avaje.ebean.config.PstmtDelegate;
import com.avaje.ebean.config.ServerConfig;
import com.avaje.ebean.config.UnderscoreNamingConvention;
import com.avaje.ebean.config.dbplatform.DatabasePlatform;
@@ -17,7 +16,6 @@ import com.avaje.ebeaninternal.api.SpiEbeanServer;
import com.avaje.ebeaninternal.server.cache.DefaultServerCacheFactory;
import com.avaje.ebeaninternal.server.cache.DefaultServerCacheManager;
import com.avaje.ebeaninternal.server.cluster.ClusterManager;
import com.avaje.ebeaninternal.server.jdbc.StandardPstmtDelegate;
import com.avaje.ebeaninternal.server.lib.ShutdownManager;
import com.avaje.ebeaninternal.server.lib.sql.DataSourceAlert;
import com.avaje.ebeaninternal.server.lib.sql.DataSourcePool;
@@ -175,16 +173,6 @@ public class DefaultContainer implements SpiContainer {
}
}
private PstmtDelegate getOraclePstmtDelegate(DataSource ds) {
if (ds instanceof DataSourcePool) {
// Using Ebean's own DataSource implementation
return new StandardPstmtDelegate();
}
return null;
}
/**
* Create and return the CacheManager.
*/
@@ -1,20 +0,0 @@
package com.avaje.ebeaninternal.server.jdbc;
import java.sql.PreparedStatement;
import com.avaje.ebean.config.PstmtDelegate;
import com.avaje.ebeaninternal.server.lib.sql.ExtendedPreparedStatement;
/**
* Implementation of PstmtDelegate from Ebean's own DataSource.
*/
public class StandardPstmtDelegate implements PstmtDelegate {
/**
* Unwrap the PreparedStatement from Ebean's DataSource implementation.
*/
public PreparedStatement unwrap(PreparedStatement pstmt) {
return ((ExtendedPreparedStatement) pstmt).getDelegate();
}
}
@@ -1 +0,0 @@
package com.avaje.ebeaninternal.server.jdbc;