public class JdbcCatalogSchema extends AbstractSchema
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.
Modifier and Type | Class and Description |
---|---|
private static class |
JdbcCatalogSchema.SubSchemaMap
Contains sub-schemas by name, and the name of the default schema.
|
AbstractSchema.Factory
Schema.TableType
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
catalog |
(package private) JdbcConvention |
convention |
(package private) javax.sql.DataSource |
dataSource |
SqlDialect |
dialect |
(package private) com.google.common.base.Supplier<JdbcCatalogSchema.SubSchemaMap> |
subSchemaMapSupplier
Sub-schemas by name, lazily initialized.
|
Constructor and Description |
---|
JdbcCatalogSchema(javax.sql.DataSource dataSource,
SqlDialect dialect,
JdbcConvention convention,
java.lang.String catalog)
Creates a JdbcCatalogSchema.
|
Modifier and Type | Method and Description |
---|---|
private JdbcCatalogSchema.SubSchemaMap |
computeSubSchemaMap() |
static JdbcCatalogSchema |
create(SchemaPlus parentSchema,
java.lang.String name,
javax.sql.DataSource dataSource,
SqlDialectFactory dialectFactory,
java.lang.String catalog) |
static JdbcCatalogSchema |
create(SchemaPlus parentSchema,
java.lang.String name,
javax.sql.DataSource dataSource,
java.lang.String catalog) |
javax.sql.DataSource |
getDataSource()
Returns the data source.
|
java.lang.String |
getDefaultSubSchemaName()
Returns the name of the default sub-schema.
|
protected java.util.Map<java.lang.String,Schema> |
getSubSchemaMap()
Returns a map of sub-schemas in this schema by name.
|
getExpression, getFunctionMultimap, getFunctionNames, getFunctions, getSubSchema, getSubSchemaNames, getTable, getTableMap, getTableNames, getType, getTypeMap, getTypeNames, isMutable, snapshot
final javax.sql.DataSource dataSource
public final SqlDialect dialect
final JdbcConvention convention
final java.lang.String catalog
final com.google.common.base.Supplier<JdbcCatalogSchema.SubSchemaMap> subSchemaMapSupplier
public JdbcCatalogSchema(javax.sql.DataSource dataSource, SqlDialect dialect, JdbcConvention convention, java.lang.String catalog)
public static JdbcCatalogSchema create(SchemaPlus parentSchema, java.lang.String name, javax.sql.DataSource dataSource, java.lang.String catalog)
public static JdbcCatalogSchema create(SchemaPlus parentSchema, java.lang.String name, javax.sql.DataSource dataSource, SqlDialectFactory dialectFactory, java.lang.String catalog)
private JdbcCatalogSchema.SubSchemaMap computeSubSchemaMap()
protected java.util.Map<java.lang.String,Schema> getSubSchemaMap()
AbstractSchema
The implementations of AbstractSchema.getSubSchemaNames()
and AbstractSchema.getSubSchema(String)
depend on this map.
The default implementation of this method returns the empty map.
Override this method to change their behavior.
getSubSchemaMap
in class AbstractSchema
public java.lang.String getDefaultSubSchemaName()
public javax.sql.DataSource getDataSource()
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.