Class DatabaseSchemaLayout
java.lang.Object
com.invirgance.convirgance.jdbc.schema.DatabaseSchemaLayout
For working with Database Object metadata for a given AutomaticDriver and DataSource.
Each database has their own way of interacting with views, tables and catalogs.
This serves as a way to create standardized reusable logic.
DatabaseSchemaLayout supports operations such as:
- Retrieving catalogs, schemas, tables, and views
- Getting the current catalog and schema
- Accessing column information for tabular structures
- Handling database-specific naming and quoting conventions
- Author:
- jbanes
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseSchemaLayout
(AutomaticDriver driver, DataSource source) Creates a new DataBaseSchemaLayout using the drivers configuration. -
Method Summary
Modifier and TypeMethodDescriptionReturns an array containing all views, tables and other structures.getAllStructures
(String type) Returns an array containing structures matching the provided table type.Table[]
Returns all the tables found matching the current drivers table type.View[]
Returns all the views found matching the current drivers view type.getCatalog
(String name) Gets the catalog with the specified name (case-insensitive)Catalog[]
Returns all catalogs.Gets the databases most recent table catalog.Returns the currentSchema
of the source.Returns the data source used to create this.Returns the driver whose configuration was used to create this.String[]
getTypes()
Returns the table types included in the schema layout.
-
Constructor Details
-
DatabaseSchemaLayout
Creates a new DataBaseSchemaLayout using the drivers configuration.- Parameters:
driver
- The driver.source
- The data source.
-
-
Method Details
-
getDriver
Returns the driver whose configuration was used to create this.- Returns:
- The driver.
-
getDataSource
Returns the data source used to create this.- Returns:
- The data source.
-
getAllStructures
Returns an array containing all views, tables and other structures.- Returns:
- An array of TabularStructures.
-
getAllStructures
Returns an array containing structures matching the provided table type. Ex: for MySQL this could be "SYSTEM VIEW"- Parameters:
type
- A string representing a type.- Returns:
- An array.
-
getCurrentCatalog
Gets the databases most recent table catalog.- Returns:
- A Catalog.
-
getCurrentSchema
Returns the currentSchema
of the source.- Returns:
- A Schema.
-
getCatalogs
Returns all catalogs.- Returns:
- Array of
Catalog
s
-
getCatalog
Gets the catalog with the specified name (case-insensitive)- Parameters:
name
- Catalog name.- Returns:
- The specified catalog.
-
getAllTables
Returns all the tables found matching the current drivers table type.- Returns:
- An array of tables.
-
getAllViews
Returns all the views found matching the current drivers view type.- Returns:
- An array of views.
-
getTypes
Returns the table types included in the schema layout. Ex: for MySQL this could be "BASE TABLE", "VIEW", "SYSTEM VIEW"- Returns:
- A String array of table types.
-