use of org.folio.cql2pgjson.model.SqlSelect in project raml-module-builder by folio-org.
the class CQL2PgJSONTest method optimizedOR.
@Test
public void optimizedOR() throws QueryValidationException {
SqlSelect s = cql2pgJson.toSql("name=* OR email=*");
assertEquals("true", s.getWhere());
s = cql2pgJson.toSql("name=* OR email=* OR zip=*");
assertEquals("true", s.getWhere());
// any that has a name
s = cql2pgJson.toSql("name=\"\"");
assertEquals("users.user_data->>'name' ~ ''", s.getWhere());
s = cql2pgJson.toSql("name=\"\" OR email=\"\"");
assertEquals("(users.user_data->>'name' ~ '') OR (users.user_data->>'email' ~ '')", s.getWhere());
}
Aggregations