#1375 - Bug: RawSql parsing fails when using placeholders

This commit is contained in:
rob bygrave
2018-05-17 12:48:08 +12:00
parent 53b606289d
commit cb0dee998b
2 changed files with 17 additions and 6 deletions
@@ -57,4 +57,19 @@ public class TestRawSqlParsing extends BaseTestCase {
assertThat(list).isNotEmpty();
}
@Test
public void testWhere() {
ResetBasicData.reset();
RawSql sql = RawSqlBuilder.parse("SELECT id, name FROM o_customer ${where}").create();
List<Customer> customers = Ebean.createQuery(Customer.class)
.setRawSql(sql)
.where().gt("id", 1)
.findList();
assertThat(customers).isNotEmpty();
}
}