EQL - parsing select clause with distinct option

This commit is contained in:
Robin Bygrave
2016-07-13 14:07:59 +12:00
parent a8c2fc2ed5
commit 49d3cc91e4
9 changed files with 695 additions and 591 deletions
@@ -284,16 +284,26 @@ public class EqlParserTest {
customer.getBillingAddress().getCity();
}
@Test
public void select() throws Exception {
ResetBasicData.reset();
Query<Customer> query = parse("select (name)");
query.findList();
assertThat(query.getGeneratedSql()).contains("select t0.id c0, t0.name c1 from o_customer t0");
}
@Test
public void selectDistinct() throws Exception {
ResetBasicData.reset();
Query<Customer> query = parse("select distinct (name)");
query.findList();
assertThat(query.getGeneratedSql()).contains("select distinct t0.name c0 from o_customer t0");
}
private Query<Customer> parse(String raw) {
Query<Customer> query = Ebean.find(Customer.class);