Module io.ebean.api
Package io.ebean

Interface DatabaseBuilder

All Known Subinterfaces:
DatabaseBuilder.Settings
All Known Implementing Classes:
DatabaseConfig

public interface DatabaseBuilder
Build a Database instance.

Note that settings() provides access to read the builder configuration (the getters). The DatabaseBuilder only has the methods to set builder configuration (the setters) so use settings() to access to everything.



   // build the 'default' database using configuration
   // from application.properties / application.yaml

   Database db = Database.builder()
     .loadFromProperties()
     .build();

 

Create a non-default database and not register it with DB. When not registered the database can not by obtained via DB.byName(String).



   Database database = Database.builder()
     .setName("other"
     .loadFromProperties()
     .setRegister(false)
     .setDefaultServer(false)
     .addClass(EBasic.class)
     .build();