Package com.exasol.dbbuilder.dialects
Class Table
- java.lang.Object
-
- com.exasol.dbbuilder.dialects.AbstractDatabaseObject
-
- com.exasol.dbbuilder.dialects.AbstractSchemaChild
-
- com.exasol.dbbuilder.dialects.Table
-
- All Implemented Interfaces:
DatabaseObject
- Direct Known Subclasses:
OracleTable
public class Table extends AbstractSchemaChild
Database table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTable.BuilderBuilder for database tables.
-
Field Summary
-
Fields inherited from class com.exasol.dbbuilder.dialects.AbstractSchemaChild
parentSchema
-
Fields inherited from class com.exasol.dbbuilder.dialects.AbstractDatabaseObject
name, owned
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTable(Table.Builder builder)Create a new table based on a given builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Table.Builderbuilder(DatabaseObjectWriter writer, Schema schema, com.exasol.db.Identifier tableName)Create a builder for aTable.TablebulkInsert(Stream<List<Object>> rows)Insert multiple rows at once.voiddrop()Drop the database object and all contained objects.intgetColumnCount()Get the number of columns the table has.List<Column>getColumns()Get the columns of the table.StringgetType()Get the type of the database object.Tableinsert(Object... values)Insert a row of values to the table.voidtruncate()Remove all rows from this table.-
Methods inherited from class com.exasol.dbbuilder.dialects.AbstractSchemaChild
getParent, hasParent
-
Methods inherited from class com.exasol.dbbuilder.dialects.AbstractDatabaseObject
getFullyQualifiedName, getName, isOwned
-
-
-
-
Constructor Detail
-
Table
protected Table(Table.Builder builder)
Create a new table based on a given builder.- Parameters:
builder- the builder from which to copy the values
-
-
Method Detail
-
builder
public static Table.Builder builder(DatabaseObjectWriter writer, Schema schema, com.exasol.db.Identifier tableName)
Create a builder for aTable.- Parameters:
writer- database object writerschema- parent schematableName- name of the database table- Returns:
- new
Tableinstance
-
getType
public String getType()
Description copied from interface:DatabaseObjectGet the type of the database object.- Returns:
- type of the database object
-
drop
public void drop()
Description copied from interface:DatabaseObjectDrop the database object and all contained objects.
-
getColumnCount
public int getColumnCount()
Get the number of columns the table has.- Returns:
- column count
-
insert
public Table insert(Object... values)
Insert a row of values to the table.- Parameters:
values- cell values- Returns:
thisfor fluent programming
-
truncate
public void truncate()
Remove all rows from this table.
-
bulkInsert
public Table bulkInsert(Stream<List<Object>> rows)
Insert multiple rows at once. Compared to inserting each row usinginsert(Object...)this is a lot faster.- Parameters:
rows- stream of rows to insert- Returns:
thisfor fluent programming
-
-