Package org.hibernate.testing.boot
Class BasicTestingJdbcServiceImpl
- java.lang.Object
-
- org.hibernate.testing.boot.BasicTestingJdbcServiceImpl
-
- All Implemented Interfaces:
java.io.Serializable,JdbcServices,Service,ServiceRegistryAwareService
public class BasicTestingJdbcServiceImpl extends java.lang.Object implements JdbcServices, ServiceRegistryAwareService
Implementation of theJdbcServicescontract for use by tests. An alternative approach is to build aServiceRegistryTestingImpland grab theJdbcServicesfrom that.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BasicTestingJdbcServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JdbcConnectionAccessgetBootstrapJdbcConnectionAccess()Obtain a JdbcConnectionAccess usable from bootstrap actions (hbm2ddl.auto, Dialect resolution, etc).DialectgetDialect()Obtain the dialect of the database.ExtractedDatabaseMetaDatagetExtractedMetaDataSupport()Obtain information about supported behavior reported by the JDBC driver.JdbcEnvironmentgetJdbcEnvironment()Obtain the JdbcEnvironment backing this JdbcServices instance.LobCreatorgetLobCreator(LobCreationContext lobCreationContext)Create an instance of aLobCreatorappropriate for the current environment, mainly meant to account for variance between JDBC 4 (<= JDK 1.6) and JDBC3 (>= JDK 1.5).ResultSetWrappergetResultSetWrapper()Obtain service for wrapping aResultSetin a "column name cache" wrapper.SqlExceptionHelpergetSqlExceptionHelper()Obtain service for dealing with exceptions.SqlStatementLoggergetSqlStatementLogger()Obtain service for logging SQL statements.voidinjectServices(ServiceRegistryImplementor serviceRegistry)Callback to inject the registry.voidprepare(boolean allowAggressiveRelease)voidrelease()voidstart()voidstop()
-
-
-
Method Detail
-
start
public void start()
-
stop
public void stop()
-
prepare
public void prepare(boolean allowAggressiveRelease) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
release
public void release()
-
getJdbcEnvironment
public JdbcEnvironment getJdbcEnvironment()
Description copied from interface:JdbcServicesObtain the JdbcEnvironment backing this JdbcServices instance.- Specified by:
getJdbcEnvironmentin interfaceJdbcServices
-
getBootstrapJdbcConnectionAccess
public JdbcConnectionAccess getBootstrapJdbcConnectionAccess()
Description copied from interface:JdbcServicesObtain a JdbcConnectionAccess usable from bootstrap actions (hbm2ddl.auto, Dialect resolution, etc).- Specified by:
getBootstrapJdbcConnectionAccessin interfaceJdbcServices
-
getDialect
public Dialect getDialect()
Description copied from interface:JdbcServicesObtain the dialect of the database.- Specified by:
getDialectin interfaceJdbcServices- Returns:
- The database dialect.
-
getLobCreator
public LobCreator getLobCreator(LobCreationContext lobCreationContext)
Description copied from interface:JdbcServicesCreate an instance of aLobCreatorappropriate for the current environment, mainly meant to account for variance between JDBC 4 (<= JDK 1.6) and JDBC3 (>= JDK 1.5).- Specified by:
getLobCreatorin interfaceJdbcServices- Parameters:
lobCreationContext- The context in which the LOB is being created- Returns:
- The LOB creator.
-
getResultSetWrapper
public ResultSetWrapper getResultSetWrapper()
Description copied from interface:JdbcServicesObtain service for wrapping aResultSetin a "column name cache" wrapper.- Specified by:
getResultSetWrapperin interfaceJdbcServices- Returns:
- The ResultSet wrapper.
-
getSqlStatementLogger
public SqlStatementLogger getSqlStatementLogger()
Description copied from interface:JdbcServicesObtain service for logging SQL statements.- Specified by:
getSqlStatementLoggerin interfaceJdbcServices- Returns:
- The SQL statement logger.
-
getSqlExceptionHelper
public SqlExceptionHelper getSqlExceptionHelper()
Description copied from interface:JdbcServicesObtain service for dealing with exceptions.- Specified by:
getSqlExceptionHelperin interfaceJdbcServices- Returns:
- The exception helper service.
-
getExtractedMetaDataSupport
public ExtractedDatabaseMetaData getExtractedMetaDataSupport()
Description copied from interface:JdbcServicesObtain information about supported behavior reported by the JDBC driver. Yuck, yuck, yuck! Much prefer this to be part of a "basic settings" type object.- Specified by:
getExtractedMetaDataSupportin interfaceJdbcServices- Returns:
- The extracted database metadata, oddly enough :)
-
injectServices
public void injectServices(ServiceRegistryImplementor serviceRegistry)
Description copied from interface:ServiceRegistryAwareServiceCallback to inject the registry.- Specified by:
injectServicesin interfaceServiceRegistryAwareService- Parameters:
serviceRegistry- The registry
-
-