Fix for select query with (*,x(y))

This commit is contained in:
Noemi Szemenyei
2021-11-10 16:11:42 +01:00
parent abf311de93
commit 6af2902ae3
2 changed files with 6 additions and 4 deletions
@@ -38,8 +38,10 @@ final class OrmQueryPropertiesParser {
return ALL;
}
final Set<String> included = splitRawSelect(rawProperties);
final boolean selectAll = included.remove("*");
return new Response(selectAll, included);
if (included.contains("*")) {
return ALL;
}
return new Response(false, included);
}
/**
@@ -223,8 +223,8 @@ public class PathPropertiesTests extends BaseTestCase {
Query<Customer> query = DB.find(Customer.class).apply(root);
query.findList();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains("select t0.status, t0.name, t0.smallnote, t0.anniversary, t0.id, t1.id, t1.line_1 from o_customer t0 left join o_address t1 on t1.id = t0.billing_address_id");
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains("select t0.id, t0.status, t0.name, t0.smallnote, t0.anniversary, t0.cretime, t0.updtime, t0.version, t0.shipping_address_id, t1.id, t1.line_1 from o_customer t0 left join o_address t1 on t1.id = t0.billing_address_id;");
}
}