Class AbstractSqliteManager
java.lang.Object
io.github.mrtesz.teszcore.db.manager.AbstractDBManager
io.github.mrtesz.teszcore.db.manager.sqlite.AbstractSqliteManager
- Direct Known Subclasses:
AsyncSqliteManager,SqliteManager
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSqliteManager(@Nullable String path, @NotNull String name, @Nullable com.zaxxer.hikari.HikariDataSource dataSource, @Nullable String projectName) -
Method Summary
Modifier and TypeMethodDescriptionasync(int timeoutSecs) Creates an AsyncDBManager with same information as the current database managervoidConnects the manager to the database again, when it is not connectedvoidconnect()Connect the database manager with the databaseprotected @NotNull com.zaxxer.hikari.HikariConfigvoidClose the database managercallsDBManager.checkConnection()and returns a database connectionsync()Creates a SyncDBManager with same information as the current database manager (When called from an AsyncDBManager the param timeoutSeconds will be forgotten)Methods inherited from class io.github.mrtesz.teszcore.db.manager.AbstractDBManager
close, isClosedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.mrtesz.teszcore.api.db.manager.DBManager
async, buildSqlWithParams, getName
-
Field Details
-
dataSource
protected com.zaxxer.hikari.HikariDataSource dataSource -
name
-
url
-
path
-
projectName
-
-
Constructor Details
-
AbstractSqliteManager
-
-
Method Details
-
createHikariConfig
@NotNull protected @NotNull com.zaxxer.hikari.HikariConfig createHikariConfig() -
connect
Description copied from interface:DBManagerConnect the database manager with the database- Throws:
IllegalStateException- if the DBManager is closed
-
checkConnection
Description copied from interface:DBManagerConnects the manager to the database again, when it is not connected- Throws:
IllegalStateException- when the DBManager is closed
-
disconnect
-
getConnection
Description copied from interface:DBManagercallsDBManager.checkConnection()and returns a database connection- Returns:
- a database connection
- Throws:
IllegalStateException- when the DBManager is closed
-
async
Description copied from interface:DBManagerCreates an AsyncDBManager with same information as the current database manager- Parameters:
timeoutSecs- TheCompletableFuture.completeOnTimeout(T, long, java.util.concurrent.TimeUnit)time in seconds- Returns:
- an asynchronous copy of the current database manager
-
sync
Description copied from interface:DBManagerCreates a SyncDBManager with same information as the current database manager (When called from an AsyncDBManager the param timeoutSeconds will be forgotten)- Returns:
- a synchronous copy of the current database manager
-