#1737 - PersistenceException while using aggregate query on related entity

This part includes support for joins off an aggregation formula
on a ManyToOne.

e.g. We use min(customer) ... to 'query join' to customer
in the query below.

    List<Contact> contacts = Ebean.find(Contact.class)
      .select("lastName, min(customer)")
      .fetchQuery("customer", "name, status")
      .findList();
This commit is contained in:
rob bygrave committed 2019-06-28 21:03:14 +12:00
1 parent 24b08663af
commit a932d61a94
7 files changed
+122 -72

No files matched your search

@@ -348,22 +348,12 @@ public class OrmQueryProperties implements Serializable {
includedBeanJoin.add(propertyName);
}
/**
* This excludes the bean joined properties.
* <p>
* This is because bean joins will have there own node in the SqlTree.
* </p>
*/
public Set<String> getSelectProperties() {
public Set<String> getSelectInclude() {
return included;
}
if (secondaryQueryJoins == null) {
return included;
}
LinkedHashSet<String> temp = new LinkedHashSet<>(2 * (secondaryQueryJoins.size() + included.size()));
temp.addAll(included);
temp.addAll(secondaryQueryJoins);
return temp;
public Set<String> getSelectQueryJoin() {
return secondaryQueryJoins;
}
void addSecondaryQueryJoin(String property) {