public class Table extends Object
| Constructor and Description |
|---|
Table(IScheduler scheduler,
Connection connection,
String name,
List<Column> columns)
Deprecated.
|
Table(IScheduler scheduler,
IConnectionHandler connection,
String name,
List<Column> columns) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(DatabaseSerializable serializable)
Add a
DatabaseSerializable to the table |
CompletableFuture<ResultSet> |
all()
Get all items from table
|
void |
clear()
Clear the table
|
CompletableFuture<List<DatabaseSerializable>> |
convertResult(ResultSet set,
DatabaseSerializable serializable)
Convert a ResultSet to a Database Serializable
|
void |
create()
Create the table in the database
|
CompletableFuture<ResultSet> |
find(String key,
Object value)
Find something inside the table
|
List<Column> |
getColumns() |
Connection |
getConnection() |
String |
getName() |
CompletableFuture<Integer> |
removeWhere(String key,
DatabaseSerializable serializable)
Remove something from the table
|
CompletableFuture<Integer> |
removeWhere(String key,
Object value)
Remove something from the table
|
void |
run(Runnable runnable)
Run something async
|
@Deprecated public Table(IScheduler scheduler, Connection connection, String name, List<Column> columns)
Table(IScheduler, IConnectionHandler, String, List)scheduler - Schedulerconnection - SQL Connectionname - Name of the tablecolumns - List of columnsColumnpublic Table(IScheduler scheduler, IConnectionHandler connection, String name, List<Column> columns)
public void create()
public CompletableFuture<List<DatabaseSerializable>> convertResult(ResultSet set, DatabaseSerializable serializable)
set - ResultSet to convertserializable - an instance of a serializable that has the DatabaseSerializable.from(Map) methodpublic CompletableFuture<ResultSet> all()
public void add(DatabaseSerializable serializable)
DatabaseSerializable to the tableserializable - Item to add to the tablepublic void clear()
public CompletableFuture<Integer> removeWhere(String key, Object value)
key - key to findvalue - Value of the keypublic CompletableFuture<Integer> removeWhere(String key, DatabaseSerializable serializable)
key - key to findserializable - serializable that contains the keypublic CompletableFuture<ResultSet> find(String key, Object value)
key - Key to findvalue - Value to findpublic void run(Runnable runnable)
runnable - Runnable to runpublic String getName()
public Connection getConnection() throws SQLException
SQLException - if something goes wrong