DBTable
| Type | 🟢 Interface |
| Package | io.github.mrtesz.teszcore.api.db.table |
| GitHub | ClassName.java |
| Extends | Copyable<DBTable> |
Description
Parent interface of all database table classes
Methods
getName
String getName();
Get the name of the table
Returns: String — the name of the table
getCreateCommand
String getCreateCommand();
Create the SQL query to create the table
Returns: String — the SQL query to create the table
getAlterColumnsCommands
Map<String, String> getAlterColumnsCommands();
Create the SQL queries to alter columns of the table
Returns: Map<String, String> — the SQL queries to alter the columns of the table mapped by <columnName, command>
getAlterIndexCommands
Map<String, String> getAlterIndexCommands();
Create the SQL queries to alter indexes of the table
Returns: Map<String, String> — the SQL queries to alter the indexes of the table mapped by <indexName, command>
setPrimaryKeys
DBTable setPrimaryKeys(String... keys);
Set primary keys of the table
| Parameter | Type | Annotations | Description |
|---|---|---|---|
keys | String... | The keys to make primary |
Returns: DBTable — the changed DBTable object
addUnique
DBTable addUnique(String... unique);
Add a unique key constellation
| Parameter | Type | Annotations | Description |
|---|---|---|---|
keys | String... | The contellation of keys to make unique |
Returns: DBTable — the changed DBTable object
addIndex
DBTable addIndex(String indexName, String column);
Add an index
| Parameter | Type | Annotations | Description |
|---|---|---|---|
indexName | String | The name of the index | |
column | String | The column name to index |
Returns: DBTable — the changed DBTable object
addColumn
DBTable addColumn(String columnName, String definition);
Add a column to the table
| Parameter | Type | Annotations | Description |
|---|---|---|---|
columnName | String | The name of the column | |
definition | String | The definition of the column |
Returns: DBTable — the changed DBTable object
addInt
DBTable addInt(String name);
DBTable addInt(String name, Integer def);
Add an integer column
| Parameter | Type | Annotations | Description |
|---|---|---|---|
name | String | The name of the column | |
def | Integer | (optional) The default value |
Returns: DBTable — the changed DBTable object
addLong
DBTable addLong(String name);
DBTable addLong(String name, long def);
Add a long column
| Parameter | Type | Annotations | Description |
|---|---|---|---|
name | String | The name of the column | |
def | long | (optional) The default value |
Returns: DBTable — the changed DBTable object
addBigInt
DBTable addBigInt(String name);
DBTable addBigInt(String name, long def);
Add a bigint column
| Parameter | Type | Annotations | Description |
|---|---|---|---|
name | String | The name of the column | |
def | long | (optional) The default value |
Returns: DBTable — the changed DBTable object
addDouble
DBTable addDouble(String name);
DBTable addDouble(String name, double def);
Add a double column
| Parameter | Type | Annotations | Description |
|---|---|---|---|
name | String | The name of the column | |
def | double | (optional) The default value |
Returns: DBTable — the changed DBTable object
addFloat
DBTable addFloat(String name);
DBTable addFloat(String name, float def);
Add a float column
| Parameter | Type | Annotations | Description |
|---|---|---|---|
name | String | The name of the column | |
def | float | (optional) The default value |
Returns: DBTable — the changed DBTable object
addText
DBTable addText(String name);
DBTable addText(String name, String def);
Add a text column
| Parameter | Type | Annotations | Description |
|---|---|---|---|
name | String | The name of the column | |
def | Integer | (optional) The default value |
Returns: DBTable — the changed DBTable object