diff --git a/src/main/java/io/ebean/BeanState.java b/src/main/java/io/ebean/BeanState.java index ac3b50470..da8c24d81 100644 --- a/src/main/java/io/ebean/BeanState.java +++ b/src/main/java/io/ebean/BeanState.java @@ -102,7 +102,7 @@ public interface BeanState { /** * Advanced - Used to programmatically build a partially or fully loaded * entity bean. First create an entity bean via - * {@link EbeanServer#createEntityBean(Class)}, then populate its properties + * {@link Database#createEntityBean(Class)}, then populate its properties * and then call this method specifying which properties where loaded or null * for a fully loaded entity bean. */ diff --git a/src/main/java/io/ebean/DatabaseFactory.java b/src/main/java/io/ebean/DatabaseFactory.java index 8bd1721b8..d050c7e24 100644 --- a/src/main/java/io/ebean/DatabaseFactory.java +++ b/src/main/java/io/ebean/DatabaseFactory.java @@ -55,7 +55,7 @@ public class DatabaseFactory { } /** - * Shutdown gracefully all EbeanServers cleaning up any resources as required. + * Shutdown gracefully all Database instances cleaning up any resources as required. *

* This is typically invoked via JVM shutdown hook and not explicitly called. *

diff --git a/src/main/java/io/ebean/Ebean.java b/src/main/java/io/ebean/Ebean.java index eb85c9509..2fc69a7bf 100644 --- a/src/main/java/io/ebean/Ebean.java +++ b/src/main/java/io/ebean/Ebean.java @@ -38,13 +38,12 @@ public final class Ebean { } /** - * Manages creation and cache of EbeanServers. + * Manages creation and cache of Databases. */ private static final Ebean.ServerManager serverMgr = new Ebean.ServerManager(); /** - * Helper class for managing fast and safe access and creation of - * EbeanServers. + * Helper class for managing fast and safe access and creation of Databases. */ private static final class ServerManager { @@ -61,7 +60,7 @@ public final class Ebean { private final Object monitor = new Object(); /** - * The 'default' EbeanServer. + * The 'default' Database. */ private EbeanServer defaultServer; @@ -80,20 +79,20 @@ public final class Ebean { throw e; } catch (DataSourceConfigurationException e) { - String msg = "Configuration error creating DataSource for the default EbeanServer." + + String msg = "Configuration error creating DataSource for the default Database." + " This typically means a missing application-test.yaml or missing ebean-test-config dependency." + " See https://ebean.io/docs/trouble-shooting#datasource"; throw new DataSourceConfigurationException(msg, e); } catch (Throwable e) { - logger.error("Error trying to create the default EbeanServer", e); + logger.error("Error trying to create the default Database", e); throw new RuntimeException(e); } } private EbeanServer getDefaultServer() { if (defaultServer == null) { - String msg = "The default EbeanServer has not been defined?"; + String msg = "The default Database has not been defined?"; msg += " This is normally set via the ebean.datasource.default property."; msg += " Otherwise it should be registered programmatically via registerServer()"; throw new PersistenceException(msg); @@ -115,7 +114,7 @@ public final class Ebean { } /** - * Synchronized read, create and put of EbeanServers. + * Synchronized read, create and put of Databases. */ private EbeanServer getWithCreate(String name) { @@ -154,7 +153,7 @@ public final class Ebean { } /** - * Get the EbeanServer for a given DataSource. If name is null this will + * Get the Database for a given DataSource. If name is null this will * return the 'default' EbeanServer. *

* This is provided to access EbeanServer for databases other than the diff --git a/src/main/java/io/ebean/Expr.java b/src/main/java/io/ebean/Expr.java index b50f1231b..ab8887c49 100644 --- a/src/main/java/io/ebean/Expr.java +++ b/src/main/java/io/ebean/Expr.java @@ -13,9 +13,8 @@ import java.util.Map; * {@link Query#where()}. *

*

- * This provides a convenient way to create expressions for the 'Default' - * server. It is actually a short cut for using the ExpressionFactory of the - * 'default' EbeanServer. + * This provides a convenient way to create expressions for the default + * database. *

* See also {@link DB#getExpressionFactory()} *

diff --git a/src/main/java/io/ebean/ExtendedServer.java b/src/main/java/io/ebean/ExtendedServer.java index ce14e17d0..ae1c1a6b6 100644 --- a/src/main/java/io/ebean/ExtendedServer.java +++ b/src/main/java/io/ebean/ExtendedServer.java @@ -15,7 +15,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; /** - * The extended API for EbeanServer. + * The extended API for Database. *

* This provides the finder methods that take an explicit transaction rather than obtaining * the transaction from the usual mechanism (which is ThreadLocal based). @@ -26,7 +26,7 @@ import java.util.function.Predicate; * the transaction to use. *

*

- * Note that in all cases the transaction supplied can be null and in this case the EbeanServer + * Note that in all cases the transaction supplied can be null and in this case the Database * will use the normal mechanism to obtain the transaction to use. *

*/ @@ -411,7 +411,7 @@ public interface ExtendedServer { /** * Execute the update query returning the number of rows updated. *

- * The update query must be created using {@link EbeanServer#update(Class)}. + * The update query must be created using {@link Database#update(Class)}. *

* * @param query the update query to execute diff --git a/src/main/java/io/ebean/Model.java b/src/main/java/io/ebean/Model.java index 80cfd3aec..60d200869 100644 --- a/src/main/java/io/ebean/Model.java +++ b/src/main/java/io/ebean/Model.java @@ -11,15 +11,15 @@ import io.ebean.bean.EntityBean; * Ebean users. *

* Note that there is a ebean-mocker project that enables you to use Mockito or similar - * tools to still mock out the underlying 'default EbeanServer' for testing purposes. + * tools to still mock out the underlying 'default Database' for testing purposes. *

* You may choose not use this Model mapped superclass if you don't like the 'Active Record' style * or if you believe it 'pollutes' your entity beans. *

- * You can use Dependency Injection like Guice or Spring to construct and wire a EbeanServer instance + * You can use Dependency Injection like Guice or Spring to construct and wire a Database instance * and have that same instance used with this Model and Finder. The way that works is that when the - * DI container creates the EbeanServer instance it can be registered with the Ebean singleton. In this - * way the EbeanServer instance can be injected as per normal Guice / Spring dependency injection and + * DI container creates the Database instance it can be registered with DB. In this + * way the Database instance can be injected as per normal Guice / Spring dependency injection and * that same instance also used to support the Model and Finder active record style. *

* If you choose to use the Model mapped superclass you will probably also chose to additionally add diff --git a/src/main/java/io/ebean/Query.java b/src/main/java/io/ebean/Query.java index 712281e48..9bc8508ca 100644 --- a/src/main/java/io/ebean/Query.java +++ b/src/main/java/io/ebean/Query.java @@ -634,7 +634,7 @@ public interface Query { /** * Execute the query returning the list of Id's. *

- * This query will execute against the EbeanServer that was used to create it. + * This query will execute against the Database that was used to create it. *

*/ @Nonnull @@ -656,7 +656,7 @@ public interface Query { * the jdbc statement and resultSet are closed at the end of the iteration. *

*

- * This query will execute against the EbeanServer that was used to create it. + * This query will execute against the Database that was used to create it. *

*
{@code
    *
@@ -759,7 +759,7 @@ public interface Query {
   /**
    * Execute the query returning the list of objects.
    * 

- * This query will execute against the EbeanServer that was used to create it. + * This query will execute against the Database that was used to create it. *

*
{@code
    *
@@ -775,7 +775,7 @@ public interface Query {
   /**
    * Execute the query returning the set of objects.
    * 

- * This query will execute against the EbeanServer that was used to create it. + * This query will execute against the Database that was used to create it. *

*
{@code
    *
@@ -791,7 +791,7 @@ public interface Query {
   /**
    * Execute the query returning a map of the objects.
    * 

- * This query will execute against the EbeanServer that was used to create it. + * This query will execute against the Database that was used to create it. *

*

* You can use setMapKey() so specify the property values to be used as keys diff --git a/src/main/java/io/ebean/Transaction.java b/src/main/java/io/ebean/Transaction.java index 4ec8e2701..e9bd914c0 100644 --- a/src/main/java/io/ebean/Transaction.java +++ b/src/main/java/io/ebean/Transaction.java @@ -20,8 +20,7 @@ public interface Transaction extends AutoCloseable { * This is the same as DB.currentTransaction() *

*

- * This returns the current transaction for the 'default server'. If you are using - * multiple EbeanServer's then use {@link DB#currentTransaction()}. + * This returns the current transaction for the default database. *

* * @see DB#currentTransaction() diff --git a/src/main/java/io/ebean/bean/BeanCollectionLoader.java b/src/main/java/io/ebean/bean/BeanCollectionLoader.java index fce7d7037..2f0e2848d 100644 --- a/src/main/java/io/ebean/bean/BeanCollectionLoader.java +++ b/src/main/java/io/ebean/bean/BeanCollectionLoader.java @@ -9,7 +9,7 @@ package io.ebean.bean; public interface BeanCollectionLoader { /** - * Return the name of the associated EbeanServer. + * Return the name of the associated Database. */ String getName(); diff --git a/src/main/java/io/ebean/bean/BeanLoader.java b/src/main/java/io/ebean/bean/BeanLoader.java index b4e004568..af96a3d01 100644 --- a/src/main/java/io/ebean/bean/BeanLoader.java +++ b/src/main/java/io/ebean/bean/BeanLoader.java @@ -9,7 +9,7 @@ package io.ebean.bean; public interface BeanLoader { /** - * Return the name of the associated EbeanServer. + * Return the name of the associated Database. */ String getName(); diff --git a/src/main/java/io/ebean/common/AbstractBeanCollection.java b/src/main/java/io/ebean/common/AbstractBeanCollection.java index 33b30f3ac..33f05fb89 100644 --- a/src/main/java/io/ebean/common/AbstractBeanCollection.java +++ b/src/main/java/io/ebean/common/AbstractBeanCollection.java @@ -20,7 +20,7 @@ abstract class AbstractBeanCollection implements BeanCollection { protected boolean disableLazyLoad; /** - * The EbeanServer this is associated with. (used for lazy fetch). + * The Database this is associated with. (used for lazy fetch). */ protected transient BeanCollectionLoader loader; diff --git a/src/main/java/io/ebean/config/AutoConfigure.java b/src/main/java/io/ebean/config/AutoConfigure.java index 879338ce5..525d3ac8b 100644 --- a/src/main/java/io/ebean/config/AutoConfigure.java +++ b/src/main/java/io/ebean/config/AutoConfigure.java @@ -1,7 +1,7 @@ package io.ebean.config; /** - * Used to provide some automatic configuration early in the creation of an EbeanServer. + * Used to provide some automatic configuration early in the creation of a Database. */ public interface AutoConfigure { diff --git a/src/main/java/io/ebean/config/AutoTuneConfig.java b/src/main/java/io/ebean/config/AutoTuneConfig.java index 7f9c0d980..e0940241b 100644 --- a/src/main/java/io/ebean/config/AutoTuneConfig.java +++ b/src/main/java/io/ebean/config/AutoTuneConfig.java @@ -1,7 +1,7 @@ package io.ebean.config; /** - * Defines the AutoTune behaviour for a EbeanServer. + * Defines the AutoTune behaviour for a Database. */ public class AutoTuneConfig { diff --git a/src/main/java/io/ebean/config/ContainerConfig.java b/src/main/java/io/ebean/config/ContainerConfig.java index 32fb98770..00cf8f8bf 100644 --- a/src/main/java/io/ebean/config/ContainerConfig.java +++ b/src/main/java/io/ebean/config/ContainerConfig.java @@ -3,7 +3,7 @@ package io.ebean.config; import java.util.Properties; /** - * Configuration for the container that holds the EbeanServer instances. + * Configuration for the container that holds the Database instances. *

* Provides configuration for cluster communication (if clustering is used). The cluster communication is * used to invalidate appropriate parts of the L2 cache across the cluster. diff --git a/src/main/java/io/ebean/config/DbMigrationConfig.java b/src/main/java/io/ebean/config/DbMigrationConfig.java index 8946d4000..54e8adcb5 100644 --- a/src/main/java/io/ebean/config/DbMigrationConfig.java +++ b/src/main/java/io/ebean/config/DbMigrationConfig.java @@ -140,7 +140,7 @@ public class DbMigrationConfig { *

* The default of "dbmigration" is reasonable in most cases. You may look to set this * to be something like "dbmigration/myapp" where myapp gives it a unique resource path - * in the case there are multiple EbeanServer applications in the single classpath. + * in the case there are multiple Database applications in the single classpath. *

*/ public void setMigrationPath(String migrationPath) { diff --git a/src/main/java/io/ebean/config/ServerConfig.java b/src/main/java/io/ebean/config/ServerConfig.java index e57e4fd45..69ba64f2c 100644 --- a/src/main/java/io/ebean/config/ServerConfig.java +++ b/src/main/java/io/ebean/config/ServerConfig.java @@ -1,7 +1,7 @@ package io.ebean.config; import com.fasterxml.jackson.core.JsonFactory; -import io.ebean.EbeanServerFactory; +import io.ebean.DatabaseFactory; import io.ebean.PersistenceContextScope; import io.ebean.Query; import io.ebean.Transaction; @@ -44,30 +44,30 @@ import java.util.Properties; import java.util.ServiceLoader; /** - * The configuration used for creating a EbeanServer. + * The configuration used for creating a Database. *

- * Used to programmatically construct an EbeanServer and optionally register it - * with the Ebean singleton. + * Used to programmatically construct a Database and optionally register it + * with the DB singleton. *

*

- * If you just use Ebean without this programmatic configuration Ebean will read - * the ebean.properties file and take the configuration from there. This usually + * If you just use DB without this programmatic configuration DB will read + * the application.properties file and take the configuration from there. This usually * includes searching the class path and automatically registering any entity * classes and listeners etc. *

*
{@code
  *
- * ServerConfig c = new ServerConfig();
+ * ServerConfig config = new ServerConfig();
  *
  * // read the ebean.properties and load
  * // those settings into this serverConfig object
- * c.loadFromProperties();
+ * config.loadFromProperties();
  *
  * // explicitly register the entity beans to avoid classpath scanning
- * c.addClass(Customer.class);
- * c.addClass(User.class);
+ * config.addClass(Customer.class);
+ * config.addClass(User.class);
  *
- * EbeanServer server = EbeanServerFactory.create(c);
+ * Database database = DatabaseFactory.create(config);
  *
  * }
* @@ -78,12 +78,12 @@ import java.util.ServiceLoader; * * @author emcgreal * @author rbygrave - * @see EbeanServerFactory + * @see DatabaseFactory */ public class ServerConfig { /** - * The EbeanServer name. + * The Database name. */ private String name = "db"; @@ -106,12 +106,12 @@ public class ServerConfig { private String resourceDirectory; /** - * Set to true to register this EbeanServer with the Ebean singleton. + * Set to true to register this Database with the DB singleton. */ private boolean register = true; /** - * Set to true if this is the default/primary server. + * Set to true if this is the default/primary database. */ private boolean defaultServer = true; @@ -150,7 +150,7 @@ public class ServerConfig { private DocStoreConfig docStoreConfig = new DocStoreConfig(); /** - * Set to true when the EbeanServer only uses Document store. + * Set to true when the Database only uses Document store. */ private boolean docStoreOnly; @@ -522,7 +522,7 @@ public class ServerConfig { private boolean idGeneratorAutomatic = true; /** - * Construct a Server Configuration for programmatically creating an EbeanServer. + * Construct a Database Configuration for programmatically creating an Database. */ public ServerConfig() { @@ -693,14 +693,14 @@ public class ServerConfig { } /** - * Return the name of the EbeanServer. + * Return the name of the Database. */ public String getName() { return name; } /** - * Set the name of the EbeanServer. + * Set the name of the Database. */ public void setName(String name) { this.name = name; @@ -709,8 +709,8 @@ public class ServerConfig { /** * Return the container / clustering configuration. *

- * The container holds all the EbeanServer instances and provides clustering communication - * services to all the EbeanServer instances. + * The container holds all the Database instances and provides clustering communication + * services to all the Database instances. */ public ContainerConfig getContainerConfig() { return containerConfig; @@ -719,8 +719,8 @@ public class ServerConfig { /** * Set the container / clustering configuration. *

- * The container holds all the EbeanServer instances and provides clustering communication - * services to all the EbeanServer instances. + * The container holds all the Database instances and provides clustering communication + * services to all the Database instances. */ public void setContainerConfig(ContainerConfig containerConfig) { this.containerConfig = containerConfig; @@ -760,8 +760,8 @@ public class ServerConfig { } /** - * Set false if you do not want this EbeanServer to be registered as the "default" server - * with the Ebean singleton. + * Set false if you do not want this Database to be registered as the "default" database + * with the DB singleton. *

* This is only used when {@link #setRegister(boolean)} is also true. *

@@ -1547,14 +1547,14 @@ public class ServerConfig { } /** - * Return true if this EbeanServer is a Document store only instance (has no JDBC DB). + * Return true if this Database is a Document store only instance (has no JDBC DB). */ public boolean isDocStoreOnly() { return docStoreOnly; } /** - * Set to true if this EbeanServer is Document store only instance (has no JDBC DB). + * Set to true if this Database is Document store only instance (has no JDBC DB). */ public void setDocStoreOnly(boolean docStoreOnly) { this.docStoreOnly = docStoreOnly; @@ -1954,16 +1954,16 @@ public class ServerConfig { } /** - * Return true if the EbeanServer instance should be created in offline mode. + * Return true if the Database instance should be created in offline mode. */ public boolean isDbOffline() { return dbOffline; } /** - * Set to true if the EbeanServer instance should be created in offline mode. + * Set to true if the Database instance should be created in offline mode. *

- * Typically used to create an EbeanServer instance for DDL Migration generation + * Typically used to create an Database instance for DDL Migration generation * without requiring a real DataSource / Database to connect to. *

*/ @@ -2214,7 +2214,7 @@ public class ServerConfig { /** * Set to true to disable the class path search even for the case where no entity bean classes - * have been registered. This can be used to start an EbeanServer instance just to use the + * have been registered. This can be used to start an Database instance just to use the * SQL functions such as SqlQuery, SqlUpdate etc. */ public void setDisableClasspathSearch(boolean disableClasspathSearch) { diff --git a/src/main/java/io/ebean/config/package.html b/src/main/java/io/ebean/config/package.html index f89a304ff..abb6ed9ba 100644 --- a/src/main/java/io/ebean/config/package.html +++ b/src/main/java/io/ebean/config/package.html @@ -1,10 +1,10 @@ - Configuration settings for EbeanServer construction + Configuration settings for Database construction -Configuration settings for EbeanServer construction +Configuration settings for Database construction diff --git a/src/main/java/io/ebean/event/BeanPersistController.java b/src/main/java/io/ebean/event/BeanPersistController.java index 15160cb28..ed46dbdef 100644 --- a/src/main/java/io/ebean/event/BeanPersistController.java +++ b/src/main/java/io/ebean/event/BeanPersistController.java @@ -9,7 +9,7 @@ package io.ebean.event; *

* Note that getTransaction() on the PersistRequest returns the transaction used * for the insert, update, delete or fetch. To explicitly use this same - * transaction you should use this transaction via methods on EbeanServer. + * transaction you should use this transaction via methods on Database. *

*
{@code
  *
diff --git a/src/main/java/io/ebean/event/BeanPostConstructListener.java b/src/main/java/io/ebean/event/BeanPostConstructListener.java
index e0fb74215..b24a343a5 100644
--- a/src/main/java/io/ebean/event/BeanPostConstructListener.java
+++ b/src/main/java/io/ebean/event/BeanPostConstructListener.java
@@ -1,6 +1,6 @@
 package io.ebean.event;
 
-import io.ebean.EbeanServer;
+import io.ebean.Database;
 
 /**
  * Fired after a bean is constructed, but not yet loaded from database.
@@ -9,7 +9,7 @@ import io.ebean.EbeanServer;
  * properties will get unload. Use {@link BeanPostLoad} instead.
  * 

* it's intended to do some dependency-injection here. - * If you plan to use this feature you should use {@link EbeanServer#createEntityBean(Class)} + * If you plan to use this feature you should use {@link Database#createEntityBean(Class)} * to create new beans. *

*/ @@ -32,7 +32,7 @@ public interface BeanPostConstructListener { void postConstruct(Object bean); /** - * Called after {@link EbeanServer#createEntityBean(Class)}. Only for new beans. + * Called after {@link Database#createEntityBean(Class)}. Only for new beans. * intended to set default values here. */ void postCreate(Object bean); diff --git a/src/main/java/io/ebean/meta/MetaInfoManager.java b/src/main/java/io/ebean/meta/MetaInfoManager.java index 8880014b7..a1638b6be 100644 --- a/src/main/java/io/ebean/meta/MetaInfoManager.java +++ b/src/main/java/io/ebean/meta/MetaInfoManager.java @@ -3,7 +3,7 @@ package io.ebean.meta; import java.util.List; /** - * Provides access to the meta data in EbeanServer such as query execution statistics. + * Provides access to the meta data in Database such as query execution statistics. */ public interface MetaInfoManager { diff --git a/src/main/java/io/ebean/meta/package-info.java b/src/main/java/io/ebean/meta/package-info.java index 26f24d774..42412dd3e 100644 --- a/src/main/java/io/ebean/meta/package-info.java +++ b/src/main/java/io/ebean/meta/package-info.java @@ -1,4 +1,4 @@ /** - * Meta data that can be retrieved for the EbeanServer. + * Meta data that can be retrieved for a Database instance. */ package io.ebean.meta; diff --git a/src/main/java/io/ebean/plugin/Plugin.java b/src/main/java/io/ebean/plugin/Plugin.java index d2107bdf9..359adce38 100644 --- a/src/main/java/io/ebean/plugin/Plugin.java +++ b/src/main/java/io/ebean/plugin/Plugin.java @@ -1,7 +1,7 @@ package io.ebean.plugin; /** - * A 'plugin' that wants to be configured on startup so it can use features of the EbeanServer itself. + * A 'plugin' that wants to be configured on startup so it can use features of the Database itself. */ public interface Plugin { diff --git a/src/main/java/io/ebean/plugin/SpiServer.java b/src/main/java/io/ebean/plugin/SpiServer.java index 4eb11837e..d7bf69b62 100644 --- a/src/main/java/io/ebean/plugin/SpiServer.java +++ b/src/main/java/io/ebean/plugin/SpiServer.java @@ -8,7 +8,7 @@ import javax.sql.DataSource; import java.util.List; /** - * Extensions to EbeanServer API made available to plugins. + * Extensions to Database API made available to plugins. */ public interface SpiServer extends EbeanServer { @@ -43,12 +43,12 @@ public interface SpiServer extends EbeanServer { BeanType getBeanTypeForQueueId(String queueId); /** - * Return the associated DataSource for this EbeanServer instance. + * Return the associated DataSource for this Database instance. */ DataSource getDataSource(); /** - * Return the associated read only DataSource for this EbeanServer instance (can be null). + * Return the associated read only DataSource for this Database instance (can be null). */ DataSource getReadOnlyDataSource(); diff --git a/src/main/java/io/ebean/plugin/package-info.java b/src/main/java/io/ebean/plugin/package-info.java index b541d543e..7c91ed6ec 100644 --- a/src/main/java/io/ebean/plugin/package-info.java +++ b/src/main/java/io/ebean/plugin/package-info.java @@ -2,7 +2,7 @@ * Provides a API for plugins. *

* Plugins can get and read meta data about the entity beans and enhance or utilise the - * functionality of the EbeanServer. + * functionality of the Database. *

*/ package io.ebean.plugin; diff --git a/src/main/java/io/ebean/service/SpiContainer.java b/src/main/java/io/ebean/service/SpiContainer.java index 3f1ffc9a1..d317ed4b8 100644 --- a/src/main/java/io/ebean/service/SpiContainer.java +++ b/src/main/java/io/ebean/service/SpiContainer.java @@ -4,7 +4,7 @@ import io.ebean.EbeanServer; import io.ebean.config.ServerConfig; /** - * Creates the EbeanServer implementations. This is used internally by the EbeanServerFactory and is not currently + * Creates the Database implementations. This is used internally by the EbeanServerFactory and is not currently * exposed as public API. */ public interface SpiContainer {