public class SimpleCatalog extends Object implements Catalog
Catalog.
This implementation uses LinkedHashMap to maintain insertion order.
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleCatalog.SimpleColumn
Simple, mutable implementation of
Column. |
static class |
SimpleCatalog.SimpleSchema
Simple, mutable implementation of
Schema. |
static class |
SimpleCatalog.SimpleTable
Simple, mutable implementation of
Table. |
| Constructor and Description |
|---|
SimpleCatalog(String name) |
| Modifier and Type | Method and Description |
|---|---|
SimpleCatalog |
addSchema(SimpleCatalog.SimpleSchema schema)
Adds a schema to this catalog.
|
SimpleCatalog.SimpleSchema |
createSchema(String schemaName)
Creates and adds a new schema to this catalog.
|
String |
getDefaultSchemaName()
Returns the default schema name, or null if not set.
|
String |
getName()
Returns the name of the catalog.
|
Schema |
getSchema(String schemaName)
Returns a schema by name, or null if not found.
|
List<String> |
getSchemaNames()
Returns all schema names in this catalog.
|
List<Schema> |
getSchemas()
Returns all schemas in this catalog.
|
Table |
getTable(String schemaName,
String tableName)
Returns a table by qualified name (schema.table), or null if not found.
|
SimpleCatalog |
setDefaultSchemaName(String defaultSchemaName)
Sets the default schema name.
|
public SimpleCatalog(String name)
public String getName()
Catalogpublic List<Schema> getSchemas()
CataloggetSchemas in interface Catalogpublic Schema getSchema(String schemaName)
Catalogpublic List<String> getSchemaNames()
CataloggetSchemaNames in interface Catalogpublic Table getTable(String schemaName, String tableName)
Catalogpublic String getDefaultSchemaName()
CataloggetDefaultSchemaName in interface Catalogpublic SimpleCatalog addSchema(SimpleCatalog.SimpleSchema schema)
schema - Schema to addpublic SimpleCatalog.SimpleSchema createSchema(String schemaName)
schemaName - Schema namepublic SimpleCatalog setDefaultSchemaName(String defaultSchemaName)
defaultSchemaName - Default schema name