mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-23 07:11:55 +00:00
#1415 - Add asDto(Class<D> dtoClass) ... to ExpressionList to support fluid style
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user