public interface DBComponents extends ConfigurationComponents, ConnectionPoolComponents
HikariCPComponents
or BoneCPComponents
to have a default implementation for accessing a connection pool.
For example:
public class MyComponents extends BuiltInComponentsFromContext implements DBComponents, HikariCPComponents { public MyComponents(ApplicationLoader.Context context) { super(context); } // required methods implementations }
ConnectionPoolComponents
Modifier and Type | Method and Description |
---|---|
ApplicationLifecycle |
applicationLifecycle() |
default Database |
database(java.lang.String name) |
default java.util.List<Database> |
databases() |
default DBApi |
dbApi() |
Environment |
environment() |
config, configuration
connectionPool
Environment environment()
ApplicationLifecycle applicationLifecycle()
default java.util.List<Database> databases()
dbApi()
.DBApi.getDatabases()
default Database database(java.lang.String name)
name
- the database namedbApi()
.DBApi.getDatabase(String)
default DBApi dbApi()