Class JdbcCatalogSchema

  • All Implemented Interfaces:
    Schema

    public class JdbcCatalogSchema
    extends AbstractSchema
    Schema based upon a JDBC catalog (database).

    This schema does not directly contain tables, but contains a sub-schema for each schema in the catalog in the back-end. Each of those sub-schemas is an instance of JdbcSchema.

    This schema is lazy: it does not compute the list of schema names until the first call to getSubSchemaMap(). Then it creates a JdbcSchema for each schema name. Each JdbcSchema will populate its tables on demand.

    • Field Detail

      • dataSource

        final javax.sql.DataSource dataSource
      • catalog

        final java.lang.String catalog
      • subSchemaMapSupplier

        final com.google.common.base.Supplier<JdbcCatalogSchema.SubSchemaMap> subSchemaMapSupplier
        Sub-schemas by name, lazily initialized.
    • Constructor Detail

      • JdbcCatalogSchema

        public JdbcCatalogSchema​(javax.sql.DataSource dataSource,
                                 SqlDialect dialect,
                                 JdbcConvention convention,
                                 java.lang.String catalog)
        Creates a JdbcCatalogSchema.
    • Method Detail

      • create

        public static JdbcCatalogSchema create​(SchemaPlus parentSchema,
                                               java.lang.String name,
                                               javax.sql.DataSource dataSource,
                                               java.lang.String catalog)
      • getDefaultSubSchemaName

        public java.lang.String getDefaultSubSchemaName()
        Returns the name of the default sub-schema.
      • getDataSource

        public javax.sql.DataSource getDataSource()
        Returns the data source.