Package org.hibernate.testing.boot
Class BasicTestingJdbcServiceImpl
java.lang.Object
org.hibernate.testing.boot.BasicTestingJdbcServiceImpl
- All Implemented Interfaces:
Serializable
,JdbcServices
,Service
,ServiceRegistryAwareService
public class BasicTestingJdbcServiceImpl
extends Object
implements JdbcServices, ServiceRegistryAwareService
Implementation of the
JdbcServices
contract for use by tests.
An alternative approach is to build a ServiceRegistryTestingImpl
and grab the JdbcServices
from that.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObtain aJdbcConnectionAccess
usable from bootstrap actions (hbm2ddl.auto,Dialect
resolution, etc).Obtain the dialect of the database.Obtain information about supported behavior reported by the JDBC driver.Obtain theJdbcEnvironment
backing thisJdbcServices
instance.getLobCreator
(LobCreationContext lobCreationContext) Create an instance of aLobCreator
appropriate for the current environment, mainly meant to account for variance between: JDBC 4 (<= JDK 1.6) and JDBC 3 (>= JDK 1.5).Obtains the service used for marking SQL parametersObtain service for dealing with exceptions.Obtain service for logging SQL statements.void
injectServices
(ServiceRegistryImplementor serviceRegistry) Callback to inject the registry.void
prepare
(boolean allowAggressiveRelease) void
release()
void
start()
void
stop()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.engine.jdbc.spi.JdbcServices
getJdbcMutationExecutor, getJdbcSelectExecutor
-
Constructor Details
-
BasicTestingJdbcServiceImpl
public BasicTestingJdbcServiceImpl()
-
-
Method Details
-
start
public void start() -
stop
public void stop() -
prepare
- Throws:
SQLException
-
release
public void release() -
getJdbcEnvironment
Description copied from interface:JdbcServices
Obtain theJdbcEnvironment
backing thisJdbcServices
instance.- Specified by:
getJdbcEnvironment
in interfaceJdbcServices
-
getBootstrapJdbcConnectionAccess
Description copied from interface:JdbcServices
Obtain aJdbcConnectionAccess
usable from bootstrap actions (hbm2ddl.auto,Dialect
resolution, etc).- Specified by:
getBootstrapJdbcConnectionAccess
in interfaceJdbcServices
-
getDialect
Description copied from interface:JdbcServices
Obtain the dialect of the database.- Specified by:
getDialect
in interfaceJdbcServices
-
getLobCreator
Description copied from interface:JdbcServices
Create an instance of aLobCreator
appropriate for the current environment, mainly meant to account for variance between:- JDBC 4 (<= JDK 1.6) and
- JDBC 3 (>= JDK 1.5).
- Specified by:
getLobCreator
in interfaceJdbcServices
- Parameters:
lobCreationContext
- The context in which the LOB is being created- Returns:
- The LOB creator.
-
getSqlStatementLogger
Description copied from interface:JdbcServices
Obtain service for logging SQL statements.- Specified by:
getSqlStatementLogger
in interfaceJdbcServices
- Returns:
- The SQL statement logger.
-
getParameterMarkerStrategy
Description copied from interface:JdbcServices
Obtains the service used for marking SQL parameters- Specified by:
getParameterMarkerStrategy
in interfaceJdbcServices
- Returns:
- the registered ParameterMarkerStrategy implementation.
-
getSqlExceptionHelper
Description copied from interface:JdbcServices
Obtain service for dealing with exceptions.- Specified by:
getSqlExceptionHelper
in interfaceJdbcServices
- Returns:
- The exception helper service.
-
getExtractedMetaDataSupport
Description copied from interface:JdbcServices
Obtain 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:
getExtractedMetaDataSupport
in interfaceJdbcServices
- Returns:
- The extracted database metadata, oddly enough :)
-
injectServices
Description copied from interface:ServiceRegistryAwareService
Callback to inject the registry.- Specified by:
injectServices
in interfaceServiceRegistryAwareService
- Parameters:
serviceRegistry
- The registry
-