You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fflib/src/classes/fflib_QueryFactory.cls
+80Lines changed: 80 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -338,6 +338,13 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr
338
338
this.order.add(o);
339
339
returnthis;
340
340
}
341
+
/**
342
+
* @paramo an instance of {@link fflib_QueryFactory.Ordering} to remove all existing (for instance defaults) and be added to the query's ORDER BY clause.
343
+
**/
344
+
publicfflib_QueryFactorysetOrdering(Orderingo){
345
+
this.order=newList<Ordering>{ o };
346
+
returnthis;
347
+
}
341
348
/**
342
349
* @returns the list of orderings that will be used as the query's ORDER BY clause. You may remove elements from the returned list, or otherwise mutate it, to remove previously added orderings.
343
350
**/
@@ -507,6 +514,23 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr
507
514
);
508
515
returnthis;
509
516
}
517
+
/**
518
+
* Remove existing ordering and set a field to be sorted on. This may be a direct field or a field
519
+
* related through an object lookup or master-detail relationship.
520
+
* Use the set to store unique field names, since we only want to sort
521
+
* by the same field one time. The sort expressions are stored in a list
522
+
* so that they are applied to the SOQL in the same order that they
523
+
* were added in.
524
+
* @paramfieldName The string value of the field to be sorted on
525
+
* @paramSortOrder the direction to be sorted on (ASCENDING or DESCENDING)
526
+
* @paramnullsLast whether to sort null values last (NULLS LAST keyword included).
0 commit comments