diff --git a/src/main/java/io/ebean/Finder.java b/src/main/java/io/ebean/Finder.java index 42d5b3910..7f944753d 100644 --- a/src/main/java/io/ebean/Finder.java +++ b/src/main/java/io/ebean/Finder.java @@ -13,8 +13,7 @@ import java.util.List; *
*- * For testing the mocki-ebean project has the ability to replace the finder implementation - *
+ * For testing the mocki-ebean project has the ability to replace the finder implementation. *
*{@code
*
@@ -24,7 +23,7 @@ import java.util.List;
* super(Customer.class);
* }
*
- * // Add your customer finder methods ...
+ * // Add finder methods ...
*
* public Customer byName(String name) {
* return query().eq("name", name).findOne();
@@ -45,6 +44,15 @@ import java.util.List;
* ...
*
* }
+ * + * When the Finder is registered as a field on Customer it can then be used like: + *
+ *{@code
+ *
+ * Customer rob = Customer.find.byName("Rob");
+ *
+ * }
+ *
*/
public class Finder {
@@ -54,9 +62,9 @@ public class Finder {
private final Class- * This provides full access to the API such as explicit transaction demarcation etc. + * Return the Database this finder will use. */ public Database db() { - return DB.byName(serverName); + return DB.byName(_$dbName); } /** @@ -120,11 +126,10 @@ public class Finder { *
* This is equivalent to {@link DB#byName(String)} * - * @param server The name of the Database. If this is null then the default EbeanServer is - * returned. + * @param databaseName The name of the Database. If this is null then the default database is returned. */ - public Database db(String server) { - return DB.byName(server); + public Database db(String databaseName) { + return DB.byName(databaseName); } /**