Top Fields Constructors Methods
org.hibernate.boot.model.relational.internal

public Class SqlStringGenerationContextImpl

extends Object
implements SqlStringGenerationContext
Class Inheritance
All Implemented Interfaces
org.hibernate.boot.model.relational.SqlStringGenerationContext
Imports
java.sql.SQLException, java.util.Map, org.hibernate.boot.model.naming.Identifier, org.hibernate.boot.model.relational.Database, .Namespace, .QualifiedName, .QualifiedSequenceName, .QualifiedTableName, .SqlStringGenerationContext, org.hibernate.cfg.AvailableSettings, org.hibernate.dialect.Dialect, org.hibernate.engine.jdbc.env.internal.QualifiedObjectNameFormatterStandardImpl, org.hibernate.engine.jdbc.env.spi.IdentifierHelper, .IdentifierHelperBuilder, .JdbcEnvironment, .NameQualifierSupport, .QualifiedObjectNameFormatter, org.jboss.logging.Logger

Field Summary

Modifier and TypeField and Description
private final Identifier
private final Identifier
private final Dialect
private final IdentifierHelper
private static final Logger
private final QualifiedObjectNameFormatter

Constructor Summary

AccessConstructor and Description
private
SqlStringGenerationContextImpl(JdbcEnvironment jdbcEnvironment, Identifier defaultCatalog, Identifier defaultSchema)

private
SqlStringGenerationContextImpl(Dialect dialect, IdentifierHelper identifierHelper, QualifiedObjectNameFormatter qualifiedObjectNameFormatter, Identifier defaultCatalog, Identifier defaultSchema)

Method Summary

Modifier and TypeMethod and Description
public Identifier
catalogWithDefault(Identifier
An explicitly configured catalog, or null.
explicitCatalogOrNull
)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.catalogWithDefault.

public static SqlStringGenerationContext
forBackwardsCompatibility(Dialect
The dialect to use.
dialect
,
String
The default catalog to use.
defaultCatalog
,
String
The default schema to use.
defaultSchema
)

Deprecated Only use for backwards compatibility in deprecated methods.
public String
format(QualifiedTableName
The table name
qualifiedName
)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.format.

Render a formatted a table name
public String
format(QualifiedSequenceName
The sequence name
qualifiedName
)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.format.

Render a formatted sequence name
public String
format(QualifiedName
The name
qualifiedName
)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.format.

Render a formatted non-table and non-sequence qualified name
public String
formatWithoutCatalog(QualifiedSequenceName
The sequence name
qualifiedName
)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.formatWithoutCatalog.

Render a formatted sequence name, without the catalog (even the default one).
public String
formatWithoutDefaults(QualifiedTableName
The table name
qualifiedName
)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.formatWithoutDefaults.

Render a formatted a table name, ignoring the default catalog/schema.
public static SqlStringGenerationContext
forTests(JdbcEnvironment jdbcEnvironment)

public static SqlStringGenerationContext
forTests(JdbcEnvironment jdbcEnvironment, String defaultCatalog, String defaultSchema)

public static SqlStringGenerationContext
fromConfigurationMap(JdbcEnvironment
The JDBC environment, to extract the dialect, identifier helper, etc.
jdbcEnvironment
,
Database
The database metadata, to retrieve the implicit namespace name configured through XML mapping.
database
,
Map<String, Object>
The configuration map, holding settings such as AvailableSettings#DEFAULT_SCHEMA.
configurationMap
)

public static SqlStringGenerationContext
fromExplicit(JdbcEnvironment
The JDBC environment, to extract the dialect, identifier helper, etc.
jdbcEnvironment
,
Database
The database metadata, to retrieve the implicit namespace name configured through XML mapping.
database
,
String
The default catalog to use; if null, will use the implicit catalog that was configured through XML mapping.
defaultCatalog
,
String
The default schema to use; if null, will use the implicit schema that was configured through XML mapping.
defaultSchema
)

public Identifier
public Identifier
public Dialect
public IdentifierHelper
public Identifier
schemaWithDefault(Identifier
An explicitly configured schema, or null.
explicitSchemaOrNull
)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.schemaWithDefault.

public Identifier
toIdentifier(String
The text form of a name as obtained from mapping information.
text
)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.toIdentifier.

Generate an Identifier instance from its simple name as obtained from mapping information.
private QualifiedTableName
private QualifiedSequenceName
private QualifiedName
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultCatalogback to summary
private final Identifier defaultCatalog
defaultSchemaback to summary
private final Identifier defaultSchema
dialectback to summary
private final Dialect dialect
identifierHelperback to summary
private final IdentifierHelper identifierHelper
logback to summary
private static final Logger log
qualifiedObjectNameFormatterback to summary
private final QualifiedObjectNameFormatter qualifiedObjectNameFormatter

Constructor Detail

SqlStringGenerationContextImplback to summary
private SqlStringGenerationContextImpl(JdbcEnvironment jdbcEnvironment, Identifier defaultCatalog, Identifier defaultSchema)
Annotations
@SuppressWarnings:deprecation
SqlStringGenerationContextImplback to summary
private SqlStringGenerationContextImpl(Dialect dialect, IdentifierHelper identifierHelper, QualifiedObjectNameFormatter qualifiedObjectNameFormatter, Identifier defaultCatalog, Identifier defaultSchema)

Method Detail

catalogWithDefaultback to summary
public Identifier catalogWithDefault(Identifier explicitCatalogOrNull)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.catalogWithDefault.

Parameters
explicitCatalogOrNull:Identifier

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.catalogWithDefault.

An explicitly configured catalog, or null.

Returns:Identifier

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.catalogWithDefault.

The given identifier if non-null, or the default catalog otherwise.

Annotations
@Override
forBackwardsCompatibilityback to summary
public static SqlStringGenerationContext forBackwardsCompatibility(Dialect dialect, String defaultCatalog, String defaultSchema)

Deprecated

Only use for backwards compatibility in deprecated methods. New methods should take the SqlStringGenerationContext as an argument, and should not need to create their own context.

Parameters
dialect:Dialect

The dialect to use.

defaultCatalog:String

The default catalog to use.

defaultSchema:String

The default schema to use.

Returns:SqlStringGenerationContext

An SqlStringGenerationContext.

Annotations
@Deprecated
formatback to summary
public String format(QualifiedTableName qualifiedName)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.format.

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.format.

Render a formatted a table name

Parameters
qualifiedName:QualifiedTableName

The table name

Returns:String

The formatted name,

Annotations
@Override
formatback to summary
public String format(QualifiedSequenceName qualifiedName)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.format.

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.format.

Render a formatted sequence name

Parameters
qualifiedName:QualifiedSequenceName

The sequence name

Returns:String

The formatted name

Annotations
@Override
formatback to summary
public String format(QualifiedName qualifiedName)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.format.

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.format.

Render a formatted non-table and non-sequence qualified name

Parameters
qualifiedName:QualifiedName

The name

Returns:String

The formatted name

Annotations
@Override
formatWithoutCatalogback to summary
public String formatWithoutCatalog(QualifiedSequenceName qualifiedName)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.formatWithoutCatalog.

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.formatWithoutCatalog.

Render a formatted sequence name, without the catalog (even the default one).

Parameters
qualifiedName:QualifiedSequenceName

The sequence name

Returns:String

The formatted name

Annotations
@Override
formatWithoutDefaultsback to summary
public String formatWithoutDefaults(QualifiedTableName qualifiedName)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.formatWithoutDefaults.

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.formatWithoutDefaults.

Render a formatted a table name, ignoring the default catalog/schema.

Parameters
qualifiedName:QualifiedTableName

The table name

Returns:String

The formatted name

Annotations
@Override
forTestsback to summary
public static SqlStringGenerationContext forTests(JdbcEnvironment jdbcEnvironment)
forTestsback to summary
public static SqlStringGenerationContext forTests(JdbcEnvironment jdbcEnvironment, String defaultCatalog, String defaultSchema)
fromConfigurationMapback to summary
public static SqlStringGenerationContext fromConfigurationMap(JdbcEnvironment jdbcEnvironment, Database database, Map<String, Object> configurationMap)
Parameters
jdbcEnvironment:JdbcEnvironment

The JDBC environment, to extract the dialect, identifier helper, etc.

database:Database

The database metadata, to retrieve the implicit namespace name configured through XML mapping.

configurationMap:Map<String, Object>

The configuration map, holding settings such as AvailableSettings#DEFAULT_SCHEMA.

Returns:SqlStringGenerationContext

An SqlStringGenerationContext.

fromExplicitback to summary
public static SqlStringGenerationContext fromExplicit(JdbcEnvironment jdbcEnvironment, Database database, String defaultCatalog, String defaultSchema)
Parameters
jdbcEnvironment:JdbcEnvironment

The JDBC environment, to extract the dialect, identifier helper, etc.

database:Database

The database metadata, to retrieve the implicit namespace name configured through XML mapping.

defaultCatalog:String

The default catalog to use; if null, will use the implicit catalog that was configured through XML mapping.

defaultSchema:String

The default schema to use; if null, will use the implicit schema that was configured through XML mapping.

Returns:SqlStringGenerationContext

An SqlStringGenerationContext.

getDefaultCatalogback to summary
public Identifier getDefaultCatalog()

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.getDefaultCatalog.

Returns:Identifier

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.getDefaultCatalog.

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 the format methods, but in some cases it can be useful to access it directly.

Annotations
@Override
getDefaultSchemaback to summary
public Identifier getDefaultSchema()

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.getDefaultSchema.

Returns:Identifier

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.getDefaultSchema.

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 the format methods, but in some cases it can be useful to access it directly.

Annotations
@Override
getDialectback to summary
public Dialect getDialect()

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.getDialect.

Returns:Dialect

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.getDialect.

The database dialect of the current JDBC environment, to generate SQL fragments that are specific to each vendor.

Annotations
@Override
getIdentifierHelperback to summary
public IdentifierHelper getIdentifierHelper()

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.getIdentifierHelper.

Returns:IdentifierHelper

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.getIdentifierHelper.

The helper for dealing with identifiers in the current JDBC environment.

Note that the Identifiers returned from this helper already account for auto-quoting.

Annotations
@Override
schemaWithDefaultback to summary
public Identifier schemaWithDefault(Identifier explicitSchemaOrNull)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.schemaWithDefault.

Parameters
explicitSchemaOrNull:Identifier

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.schemaWithDefault.

An explicitly configured schema, or null.

Returns:Identifier

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.schemaWithDefault.

The given identifier if non-null, or the default schema otherwise.

Annotations
@Override
toIdentifierback to summary
public Identifier toIdentifier(String text)

Implements org.hibernate.boot.model.relational.SqlStringGenerationContext.toIdentifier.

Doc from org.hibernate.boot.model.relational.SqlStringGenerationContext.toIdentifier.

Generate 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.

Parameters
text:String

The text form of a name as obtained from mapping information.

Returns:Identifier

The identifier form of the name.

Annotations
@Override
withDefaultsback to summary
private QualifiedTableName withDefaults(QualifiedTableName name)
withDefaultsback to summary
private QualifiedSequenceName withDefaults(QualifiedSequenceName name)
withDefaultsback to summary
private QualifiedName withDefaults(QualifiedName name)