Package com.exasol.dbbuilder.dialects
Class AbstractSchema
- java.lang.Object
-
- com.exasol.dbbuilder.dialects.AbstractDatabaseObject
-
- com.exasol.dbbuilder.dialects.AbstractSchema
-
- All Implemented Interfaces:
DatabaseObject,Schema
- Direct Known Subclasses:
ExasolSchema,MySqlSchema
public abstract class AbstractSchema extends AbstractDatabaseObject implements Schema
This class contains common logic for a database schema.
-
-
Constructor Summary
Constructors Constructor Description AbstractSchema(com.exasol.db.Identifier name)Create a new database schema.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TablecreateTable(String name, String column1Name, String column1Type)Create a table with one column.TablecreateTable(String name, String column1Name, String column1Type, String column2Name, String column2Type)Create a table with two columns.TablecreateTable(String name, String column1Name, String column1Type, String column2Name, String column2Type, String column3Name, String column3Type)Create a table with three columns.TablecreateTable(String name, List<String> columnNames, List<String> columnTypes)Create a table with an arbitrary number of columns.Table.BuildercreateTableBuilder(String name)Create a builder for a table.protected abstract com.exasol.db.IdentifiergetIdentifier(String name)Get an instance ofIdentifier.List<Table>getTables()Get the tables inside this schema.protected abstract DatabaseObjectWritergetWriter()Get aDatabaseObjectWriter.-
Methods inherited from class com.exasol.dbbuilder.dialects.AbstractDatabaseObject
getFullyQualifiedName, getName, isOwned
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.exasol.dbbuilder.dialects.DatabaseObject
getFullyQualifiedName, getName, isOwned
-
-
-
-
Method Detail
-
getWriter
protected abstract DatabaseObjectWriter getWriter()
Get aDatabaseObjectWriter.- Returns:
DatabaseObjectWriter
-
getTables
public List<Table> getTables()
Description copied from interface:SchemaGet the tables inside this schema.
-
createTable
public Table createTable(String name, String column1Name, String column1Type)
Description copied from interface:SchemaCreate a table with one column.- Specified by:
createTablein interfaceSchema- Parameters:
name- name of the tablecolumn1Name- name of the first columncolumn1Type- type of the first column- Returns:
- table
-
createTable
public Table createTable(String name, String column1Name, String column1Type, String column2Name, String column2Type)
Description copied from interface:SchemaCreate a table with two columns.- Specified by:
createTablein interfaceSchema- Parameters:
name- name of the tablecolumn1Name- name of the first columncolumn1Type- type of the first columncolumn2Name- name of the second columncolumn2Type- type of the second column- Returns:
- table
-
createTable
public Table createTable(String name, String column1Name, String column1Type, String column2Name, String column2Type, String column3Name, String column3Type)
Description copied from interface:SchemaCreate a table with three columns.- Specified by:
createTablein interfaceSchema- Parameters:
name- name of the tablecolumn1Name- name of the first columncolumn1Type- type of the first columncolumn2Name- name of the second columncolumn2Type- type of the second columncolumn3Name- name of the third columncolumn3Type- type of the third column- Returns:
- table
-
createTableBuilder
public Table.Builder createTableBuilder(String name)
Create a builder for a table.In cases where you need a more complex table than can be created by the convenience methods
createTable, this method provides a builder.- Parameters:
name- table name- Returns:
- builder for the table
-
createTable
public Table createTable(String name, List<String> columnNames, List<String> columnTypes)
Description copied from interface:SchemaCreate a table with an arbitrary number of columns.- Specified by:
createTablein interfaceSchema- Parameters:
name- name of the tablecolumnNames- list of column namescolumnTypes- list of column types- Returns:
- table
-
getIdentifier
protected abstract com.exasol.db.Identifier getIdentifier(String name)
Get an instance ofIdentifier.- Parameters:
name- identifier id- Returns:
- instance of
Identifier
-
-