Class JdbcEnvironmentImpl
- java.lang.Object
-
- org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentImpl
-
- All Implemented Interfaces:
Serializable
,JdbcEnvironment
,Service
public class JdbcEnvironmentImpl extends Object implements JdbcEnvironment
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
SCHEMA_NAME_RESOLVER
-
Constructor Summary
Constructors Constructor Description JdbcEnvironmentImpl(DatabaseMetaData databaseMetaData, Dialect dialect, JdbcConnectionAccess jdbcConnectionAccess)
Constructor form used from testingJdbcEnvironmentImpl(ServiceRegistryImplementor serviceRegistry, Dialect dialect)
Constructor form used when the JDBCDatabaseMetaData
is not available.JdbcEnvironmentImpl(ServiceRegistryImplementor serviceRegistry, Dialect dialect, DatabaseMetaData databaseMetaData)
Deprecated.currently used by Hibernate Reactive This version of the constructor should handle the case in which we do actually have the option to access the DatabaseMetaData, but since Hibernate Reactive is currently not making use of it we take a shortcut.JdbcEnvironmentImpl(ServiceRegistryImplementor serviceRegistry, Dialect dialect, DatabaseMetaData databaseMetaData, JdbcConnectionAccess jdbcConnectionAccess)
The main constructor form.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Identifier
getCurrentCatalog()
Get the current database catalog.Identifier
getCurrentSchema()
Get the current database catalog.Dialect
getDialect()
Get the dialect for this environment.ExtractedDatabaseMetaData
getExtractedDatabaseMetaData()
Access to the bits of information we pulled off the JDBCDatabaseMetaData
(that did not get "interpreted" into the helpers/delegates available here).IdentifierHelper
getIdentifierHelper()
Obtain the helper for dealing with identifiers in this environment.LobCreatorBuilder
getLobCreatorBuilder()
Retrieve the delegate for buildingLobCreator
instances.NameQualifierSupport
getNameQualifierSupport()
Obtain the level of support for qualified names.QualifiedObjectNameFormatter
getQualifiedObjectNameFormatter()
Obtain support for formatting qualified object names.SqlAstTranslatorFactory
getSqlAstTranslatorFactory()
SqlExceptionHelper
getSqlExceptionHelper()
Obtain the helper for dealing with JDBCSQLException
faults.
-
-
-
Field Detail
-
SCHEMA_NAME_RESOLVER
public static final String SCHEMA_NAME_RESOLVER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JdbcEnvironmentImpl
public JdbcEnvironmentImpl(ServiceRegistryImplementor serviceRegistry, Dialect dialect)
Constructor form used when the JDBCDatabaseMetaData
is not available.- Parameters:
serviceRegistry
- The service registrydialect
- The resolved dialect.
-
JdbcEnvironmentImpl
public JdbcEnvironmentImpl(DatabaseMetaData databaseMetaData, Dialect dialect, JdbcConnectionAccess jdbcConnectionAccess) throws SQLException
Constructor form used from testing- Throws:
SQLException
-
JdbcEnvironmentImpl
@Deprecated public JdbcEnvironmentImpl(ServiceRegistryImplementor serviceRegistry, Dialect dialect, DatabaseMetaData databaseMetaData) throws SQLException
Deprecated.currently used by Hibernate Reactive This version of the constructor should handle the case in which we do actually have the option to access the DatabaseMetaData, but since Hibernate Reactive is currently not making use of it we take a shortcut.- Throws:
SQLException
-
JdbcEnvironmentImpl
public JdbcEnvironmentImpl(ServiceRegistryImplementor serviceRegistry, Dialect dialect, DatabaseMetaData databaseMetaData, JdbcConnectionAccess jdbcConnectionAccess) throws SQLException
The main constructor form. Builds a JdbcEnvironment using the available DatabaseMetaData- Parameters:
serviceRegistry
- The service registrydialect
- The resolved dialectdatabaseMetaData
- The available DatabaseMetaData- Throws:
SQLException
-
-
Method Detail
-
getDialect
public Dialect getDialect()
Description copied from interface:JdbcEnvironment
Get the dialect for this environment.- Specified by:
getDialect
in interfaceJdbcEnvironment
- Returns:
- The dialect.
-
getSqlAstTranslatorFactory
public SqlAstTranslatorFactory getSqlAstTranslatorFactory()
- Specified by:
getSqlAstTranslatorFactory
in interfaceJdbcEnvironment
-
getExtractedDatabaseMetaData
public ExtractedDatabaseMetaData getExtractedDatabaseMetaData()
Description copied from interface:JdbcEnvironment
Access to the bits of information we pulled off the JDBCDatabaseMetaData
(that did not get "interpreted" into the helpers/delegates available here).- Specified by:
getExtractedDatabaseMetaData
in interfaceJdbcEnvironment
- Returns:
- The values extracted from JDBC DatabaseMetaData
-
getCurrentCatalog
public Identifier getCurrentCatalog()
Description copied from interface:JdbcEnvironment
Get the current database catalog. Typically will come from eitherConnection.getCatalog()
or "hibernate.default_catalog".- Specified by:
getCurrentCatalog
in interfaceJdbcEnvironment
- Returns:
- The current catalog.
-
getCurrentSchema
public Identifier getCurrentSchema()
Description copied from interface:JdbcEnvironment
Get the current database catalog. Typically will come from eitherSchemaNameResolver.resolveSchemaName(java.sql.Connection, Dialect)
or "hibernate.default_catalog".- Specified by:
getCurrentSchema
in interfaceJdbcEnvironment
- Returns:
- The current schema
-
getQualifiedObjectNameFormatter
public QualifiedObjectNameFormatter getQualifiedObjectNameFormatter()
Description copied from interface:JdbcEnvironment
Obtain support for formatting qualified object names.- Specified by:
getQualifiedObjectNameFormatter
in interfaceJdbcEnvironment
- Returns:
- Qualified name support.
-
getIdentifierHelper
public IdentifierHelper getIdentifierHelper()
Description copied from interface:JdbcEnvironment
Obtain the helper for dealing with identifiers in this environment.Note that the Identifiers returned from this IdentifierHelper already account for auto-quoting :) yaay!
- Specified by:
getIdentifierHelper
in interfaceJdbcEnvironment
- Returns:
- The identifier helper.
-
getNameQualifierSupport
public NameQualifierSupport getNameQualifierSupport()
Description copied from interface:JdbcEnvironment
Obtain the level of support for qualified names.- Specified by:
getNameQualifierSupport
in interfaceJdbcEnvironment
- Returns:
- The NameQualifierSupport.
-
getSqlExceptionHelper
public SqlExceptionHelper getSqlExceptionHelper()
Description copied from interface:JdbcEnvironment
Obtain the helper for dealing with JDBCSQLException
faults.- Specified by:
getSqlExceptionHelper
in interfaceJdbcEnvironment
- Returns:
- This environment's helper.
-
getLobCreatorBuilder
public LobCreatorBuilder getLobCreatorBuilder()
Description copied from interface:JdbcEnvironment
Retrieve the delegate for buildingLobCreator
instances.- Specified by:
getLobCreatorBuilder
in interfaceJdbcEnvironment
- Returns:
- The LobCreator builder.
-
-