Package play.db
Interface DBComponents
-
- All Superinterfaces:
ConfigurationComponents
,ConnectionPoolComponents
- All Known Subinterfaces:
JPAComponents
public interface DBComponents extends ConfigurationComponents, ConnectionPoolComponents
Java DB components. You can mix inHikariCPComponents
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 }
- See Also:
ConnectionPoolComponents
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ApplicationLifecycle
applicationLifecycle()
default Database
database(String name)
default List<Database>
databases()
default DBApi
dbApi()
Environment
environment()
-
Methods inherited from interface play.components.ConfigurationComponents
config, configuration
-
Methods inherited from interface play.db.ConnectionPoolComponents
connectionPool
-
-
-
-
Method Detail
-
environment
Environment environment()
-
applicationLifecycle
ApplicationLifecycle applicationLifecycle()
-
databases
default List<Database> databases()
- Returns:
- all databases associated with the
dbApi()
. - See Also:
DBApi.getDatabases()
-
database
default Database database(String name)
- Parameters:
name
- the database name- Returns:
- the database with the given name, associated with the
dbApi()
. - See Also:
DBApi.getDatabase(String)
-
dbApi
default DBApi dbApi()
-
-