public interface DatabaseBridge
Modifier and Type | Method and Description |
---|---|
void |
batchOperations(boolean batchOperations)
Set whether to execute operations in batches or not.
|
void |
deleteObject(java.lang.String table,
DatabaseFilter filter)
Delete the object from the database.
|
void |
insertObject(java.lang.String table,
Pair<java.lang.String,java.lang.Object>... columns)
Insert the object in the database.
|
void |
loadAllObjects(java.lang.String table,
java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> resultConsumer)
Load all the objects from the database.
|
void |
loadObject(java.lang.String table,
DatabaseFilter filter,
java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> resultConsumer)
Load data from the database for this object.
|
void |
setDatabaseBridgeMode(DatabaseBridgeMode databaseBridgeMode)
Set the mode for the database bridge.
|
default void |
startSavingData()
Deprecated.
|
void |
updateObject(java.lang.String table,
DatabaseFilter filter,
Pair<java.lang.String,java.lang.Object>... columns)
Update the object in the database.
|
void loadAllObjects(java.lang.String table, java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> resultConsumer)
table:
- The table to load the objects from.resultConsumer
- Consumer that receives each object from the database.@Deprecated default void startSavingData()
setDatabaseBridgeMode(DatabaseBridgeMode)
void batchOperations(boolean batchOperations)
void updateObject(java.lang.String table, @Nullable DatabaseFilter filter, Pair<java.lang.String,java.lang.Object>... columns)
table
- The name of the table in the database.filter
- The filter of the column.columns
- All columns to be saved with their values.void insertObject(java.lang.String table, Pair<java.lang.String,java.lang.Object>... columns)
table
- The name of the table in the database.columns
- All columns to be saved with their values.void deleteObject(java.lang.String table, @Nullable DatabaseFilter filter)
table
- The name of the table in the database.filter
- The filter of the column.void loadObject(java.lang.String table, @Nullable DatabaseFilter filter, java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> resultConsumer)
table
- The table to get the data from.filter
- The filter of the column.resultConsumer
- Consumer that receives data for each row.void setDatabaseBridgeMode(DatabaseBridgeMode databaseBridgeMode)
databaseBridgeMode
- The DatabaseBridgeMode
mode to set.