Class SqlStringGenerationContextImpl
java.lang.Object
org.hibernate.boot.model.relational.internal.SqlStringGenerationContextImpl
- All Implemented Interfaces:
SqlStringGenerationContext
-
Method Summary
Modifier and TypeMethodDescriptionformat(QualifiedName qualifiedName) Render a formatted non-table and non-sequence qualified nameformat(QualifiedSequenceName qualifiedName) Render a formatted sequence nameformat(QualifiedTableName qualifiedName) Render a formatted a table nameformatWithoutCatalog(QualifiedSequenceName qualifiedName) Render a formatted sequence name, without the catalog (even the default one).static SqlStringGenerationContextforTests(JdbcEnvironment jdbcEnvironment) static SqlStringGenerationContextforTests(JdbcEnvironment jdbcEnvironment, String defaultCatalog, String defaultSchema) static SqlStringGenerationContextfromConfigurationMap(JdbcEnvironment jdbcEnvironment, Database database, Map<String, Object> configurationMap) static SqlStringGenerationContextfromConfigurationMapForMigration(JdbcEnvironment jdbcEnvironment, Database database, Map<String, Object> configurationMap) static SqlStringGenerationContextfromExplicit(JdbcEnvironment jdbcEnvironment, Database database, String defaultCatalog, String defaultSchema) booleanIs the generated SQL for use in schema migration?toIdentifier(String text) Generate an Identifier instance from its simple name as obtained from mapping information.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.boot.model.relational.SqlStringGenerationContext
catalogWithDefault, schemaWithDefault, withDefaults, withDefaults, withDefaults
-
Method Details
-
fromConfigurationMap
public static SqlStringGenerationContext fromConfigurationMap(JdbcEnvironment jdbcEnvironment, Database database, Map<String, Object> configurationMap) - Parameters:
jdbcEnvironment- The JDBC environment, to extract the dialect, identifier helper, etc.database- The database metadata, to retrieve the implicit namespace name configured through XML mapping.configurationMap- The configuration map, holding settings such as "hibernate.default_schema".- Returns:
- An
SqlStringGenerationContext.
-
fromConfigurationMapForMigration
public static SqlStringGenerationContext fromConfigurationMapForMigration(JdbcEnvironment jdbcEnvironment, Database database, Map<String, Object> configurationMap) - Parameters:
jdbcEnvironment- The JDBC environment, to extract the dialect, identifier helper, etc.database- The database metadata, to retrieve the implicit namespace name configured through XML mapping.configurationMap- The configuration map, holding settings such as "hibernate.default_schema".- Returns:
- An
SqlStringGenerationContext.
-
fromExplicit
public static SqlStringGenerationContext fromExplicit(JdbcEnvironment jdbcEnvironment, Database database, String defaultCatalog, String defaultSchema) - Parameters:
jdbcEnvironment- The JDBC environment, to extract the dialect, identifier helper, etc.database- The database metadata, to retrieve the implicit namespace name configured through XML mapping.defaultCatalog- The default catalog to use; ifnull, will use the implicit catalog that was configured through XML mapping.defaultSchema- The default schema to use; ifnull, will use the implicit schema that was configured through XML mapping.- Returns:
- An
SqlStringGenerationContext.
-
forTests
-
forTests
public static SqlStringGenerationContext forTests(JdbcEnvironment jdbcEnvironment, String defaultCatalog, String defaultSchema) -
getDialect
- Specified by:
getDialectin interfaceSqlStringGenerationContext- Returns:
- The database dialect of the current JDBC environment, to generate SQL fragments that are specific to each vendor.
-
toIdentifier
Description copied from interface:SqlStringGenerationContextGenerate an Identifier instance from its simple name as obtained from mapping information.Note that Identifiers returned from here may be implicitly quoted based on 'globally quoted identifiers' or based on reserved words.
- Specified by:
toIdentifierin interfaceSqlStringGenerationContext- Parameters:
text- The text form of a name as obtained from mapping information.- Returns:
- The identifier form of the name.
-
getDefaultCatalog
- Specified by:
getDefaultCatalogin interfaceSqlStringGenerationContext- Returns:
- The default catalog, used for table/sequence names that do not explicitly mention a catalog.
May be
null. This default is generally applied automatically by theformat methods, but in some cases it can be useful to access it directly.
-
getDefaultSchema
- Specified by:
getDefaultSchemain interfaceSqlStringGenerationContext- Returns:
- The default schema, used for table/sequence names that do not explicitly mention a schema.
May be
null. This default is generally applied automatically by theformat methods, but in some cases it can be useful to access it directly.
-
format
Description copied from interface:SqlStringGenerationContextRender a formatted a table name- Specified by:
formatin interfaceSqlStringGenerationContext- Parameters:
qualifiedName- The table name- Returns:
- The formatted name,
-
format
Description copied from interface:SqlStringGenerationContextRender a formatted sequence name- Specified by:
formatin interfaceSqlStringGenerationContext- Parameters:
qualifiedName- The sequence name- Returns:
- The formatted name
-
format
Description copied from interface:SqlStringGenerationContextRender a formatted non-table and non-sequence qualified name- Specified by:
formatin interfaceSqlStringGenerationContext- Parameters:
qualifiedName- The name- Returns:
- The formatted name
-
formatWithoutCatalog
Description copied from interface:SqlStringGenerationContextRender a formatted sequence name, without the catalog (even the default one).- Specified by:
formatWithoutCatalogin interfaceSqlStringGenerationContext- Parameters:
qualifiedName- The sequence name- Returns:
- The formatted name
-
isMigration
public boolean isMigration()Description copied from interface:SqlStringGenerationContextIs the generated SQL for use in schema migration?- Specified by:
isMigrationin interfaceSqlStringGenerationContext- Returns:
trueif and only if this is a migration
-