public interface DBComponents extends ConfigurationComponents, ConnectionPoolComponents
HikariCPComponents
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(String name) |
default List<Database> |
databases() |
default DBApi |
dbApi() |
Environment |
environment() |
config, configuration
connectionPool
Environment environment()
ApplicationLifecycle applicationLifecycle()
default List<Database> databases()
dbApi()
.DBApi.getDatabases()
default Database database(String name)
name
- the database namedbApi()
.DBApi.getDatabase(String)
default DBApi dbApi()