Skip to content

Commit

Permalink
Merge pull request #3263 from ebean-orm/feature/DatabaseBuilder-take-2
Browse files Browse the repository at this point in the history
DatabaseBuilder take 2
  • Loading branch information
rbygrave authored Nov 5, 2023
2 parents 89741b9 + 3edc232 commit 102d8d5
Show file tree
Hide file tree
Showing 116 changed files with 4,115 additions and 1,867 deletions.
4 changes: 2 additions & 2 deletions composites/ebean/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-joda-time</artifactId>
<version>13.18.0</version>
<version>13.24.0-RC2</version>
</dependency>

<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-jsonnode</artifactId>
<version>13.18.0</version>
<version>13.24.0-RC2</version>
</dependency>

<dependency>
Expand Down
19 changes: 18 additions & 1 deletion ebean-api/src/main/java/io/ebean/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* <h5>Constructing a Database</h5>
* <p>
* Databases are constructed by the DatabaseFactory. They can be created
* programmatically via {@link DatabaseFactory#create(DatabaseConfig)} or they
* programmatically via {@link DatabaseFactory#create(DatabaseBuilder)} or they
* can be automatically constructed on demand using configuration information in
* the application.properties file.
*
Expand Down Expand Up @@ -86,6 +86,23 @@
@NonNullApi
public interface Database {

/**
* Return a new database builder.
* <pre>{@code
*
* // build the 'default' database using configuration
* // from application.properties / application.yaml
*
* Database db = Database.builder()
* .loadFromProperties()
* .build();
*
* }</pre>
*/
static DatabaseBuilder builder() {
return new DatabaseConfig();
}

/**
* Shutdown the Database instance.
*/
Expand Down
Loading

0 comments on commit 102d8d5

Please sign in to comment.