#1415 - Add asDto(Class<D> dtoClass) ... to ExpressionList to support fluid style

This commit is contained in:
rob bygrave committed 2018-06-11 13:29:13 +12:00
1 parent ec2f1f7243
commit 258e29d2f0
4 files changed
+35

No files matched your search

@@ -256,6 +256,21 @@ public class DtoQueryFromOrmTest extends BaseTestCase {
assertThat(sql.get(0)).contains("select t0.last_name, count(*) totalCount from contact t0 where t0.last_name is not null group by t0.last_name having count(*) > ?");
}
@Test
public void toDto_fromExpressionList() {
ResetBasicData.reset();
List<ContactTotals> contactDtos
= Ebean.find(Contact.class)
.select("lastName, count(*) as totalCount")
.where().isNotNull("lastName")
.asDto(ContactTotals.class)
.findList();
assertThat(contactDtos).isNotEmpty();
}
public static class ContactTotals {
String lastName;