mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
EQL - parsing select clause with distinct option
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user