Skip to content

Commit

Permalink
Having Draft
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr PG Gajek <[email protected]>
  • Loading branch information
pgajek2 committed Sep 28, 2024
1 parent a2770ea commit dd77070
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions force-app/main/default/classes/SOQL.cls
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ public virtual inherited sharing class SOQL implements Queryable {
Queryable groupByRollup(String relationshipName, SObjectField field);
Queryable groupByCube(SObjectField field);
Queryable groupByCube(String relationshipName, SObjectField field);
// HAVING
Queryable have();
// ORDER BY
Queryable orderBy(String field);
Queryable orderBy(String field, String direction);
Expand Down Expand Up @@ -603,6 +605,10 @@ public virtual inherited sharing class SOQL implements Queryable {
return this;
}

public SOQL have() {
return this;
}

public SOQL orderBy(String field) {
builder.orderBys.newOrderBy().with(field);
return this;
Expand Down Expand Up @@ -1691,6 +1697,18 @@ public virtual inherited sharing class SOQL implements Queryable {
}
}

private virtual class SoqlHavingGroup implements QueryClause {
public String buildNested() {
return '';
}
}

private class MainHavingGroup extends SoqlHavingGroup {
public override String toString() {
return 'HAVING ' + buildNested();
}
}

private class SoqlOrderBy implements QueryClause {
private String orderField;
private String sortingOrder = 'ASC';
Expand Down

0 comments on commit dd77070

Please sign in to comment.