Interface SqlStringGenerationContext

All Known Implementing Classes:
ExplicitSqlStringGenerationContext, SqlStringGenerationContextImpl

public interface SqlStringGenerationContext
A context provided to methods responsible for generating SQL strings on startup.
  • Method Details

    • getDialect

      Dialect getDialect()
      Returns:
      The database dialect of the current JDBC environment, to generate SQL fragments that are specific to each vendor.
    • toIdentifier

      Identifier toIdentifier(String text)
      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 - The text form of a name as obtained from mapping information.
      Returns:
      The identifier form of the name.
    • getDefaultCatalog

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

      default Identifier catalogWithDefault(Identifier explicitCatalogOrNull)
      Interpret the incoming catalog, returning the incoming value if it is non-null. Otherwise, returns the current default catalog.
      API Note:
      May return null if default catalog is null.
    • getDefaultSchema

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

      default Identifier schemaWithDefault(Identifier explicitSchemaOrNull)
      Interpret the incoming schema, returning the incoming value if it is non-null. Otherwise, returns the current default schema.
      API Note:
      May return null if default schema is null.
    • format

      String format(QualifiedTableName qualifiedName)
      Render a formatted a table name
      Parameters:
      qualifiedName - The table name
      Returns:
      The formatted name,
    • format

      String format(QualifiedSequenceName qualifiedName)
      Render a formatted sequence name
      Parameters:
      qualifiedName - The sequence name
      Returns:
      The formatted name
    • format

      String format(QualifiedName qualifiedName)
      Render a formatted non-table and non-sequence qualified name
      Parameters:
      qualifiedName - The name
      Returns:
      The formatted name
    • formatWithoutCatalog

      String formatWithoutCatalog(QualifiedSequenceName qualifiedName)
      Render a formatted sequence name, without the catalog (even the default one).
      Parameters:
      qualifiedName - The sequence name
      Returns:
      The formatted name
    • isMigration

      boolean isMigration()
      Is the generated SQL for use in schema migration?
      Returns:
      true if and only if this is a migration
    • withDefaults

      default QualifiedTableName withDefaults(QualifiedTableName name)
      Apply default catalog and schema, if necessary, to the given name. May return a new reference.
    • withDefaults

      default QualifiedSequenceName withDefaults(QualifiedSequenceName name)
      Apply default catalog and schema, if necessary, to the given name. May return a new reference.
    • withDefaults

      default QualifiedName withDefaults(QualifiedName name)
      Apply default catalog and schema, if necessary, to the given name. May return a new reference.