mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
ENH: Add query.usingDatabase(database)
This commit is contained in:
@@ -2,6 +2,7 @@ package org.tests.basic;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Database;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
@@ -18,6 +19,21 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class TestQueryUsingConnection extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void usingDatabase() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
final Database database = DB.getDefault();
|
||||
|
||||
int count =
|
||||
DB.find(Country.class)
|
||||
.usingDatabase(database)
|
||||
.findCount();
|
||||
|
||||
assertThat(count).isGreaterThan(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void usingConnection() throws SQLException {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user