#324 - ENH: Add Ebean.getDefaultServer()

This commit is contained in:
Robin Bygrave
2015-07-18 07:46:42 +12:00
parent f7bbd5b3bb
commit 0e0fa37f0d
2 changed files with 13 additions and 3 deletions
+11 -1
View File
@@ -254,12 +254,22 @@ public final class Ebean {
* }</pre>
*
* @param name
* the name of the server, use null for the 'default server'
* the name of the server, can use null for the 'default server'
*/
public static EbeanServer getServer(String name) {
return serverMgr.get(name);
}
/**
* Returns the default EbeanServer.
* <p>
* This is equivalent to <code>Ebean.getServer(null);</code>
* </p>
*/
public static EbeanServer getDefaultServer() {
return getServer(null);
}
/**
* Return the ExpressionFactory from the default server.
* <p>
+2 -2
View File
@@ -152,7 +152,7 @@ public abstract class Model {
* }</pre>
*/
public static EbeanServer db() {
return Ebean.getServer(null);
return Ebean.getDefaultServer();
}
/**
@@ -451,8 +451,8 @@ public abstract class Model {
* Construct passing the class literal type of the entity type.
*/
protected Find(String serverName, Class<T> type) {
this.type = type;
this.serverName = serverName;
this.type = type;
}
/**