mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-03 08:24:23 +00:00
#386 - ENH: Add setDistinct() onto ExpressionList ... so you don't need to get back to the query(and #385 javadoc)
This commit is contained in:
1 parent
580b51381e
commit
1a0f3a6614
5 files changed
+57
-1
No files matched your search
@@ -41,7 +41,22 @@ public class TestQueryDistinct extends BaseTestCase {
|
||||
Assert.assertNull(customer.getAnniversary());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test_onWhere() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
Query<Customer> query = Ebean.find(Customer.class)
|
||||
.setUseCache(false)
|
||||
.where().setDistinct(true)
|
||||
.select("name");
|
||||
|
||||
query.findList();
|
||||
|
||||
String generatedSql = query.getGeneratedSql();
|
||||
Assert.assertTrue(generatedSql.contains("select distinct t0.name c0 from o_customer t0"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDistinctStatus() {
|
||||
|
||||
Reference in new issue
Block a user