v1.0.2
31-May-2023
Changes
with(field1 - field5)
Make code easier to read by new with
methods.
SOQL with(SObjectField field)
SOQL with(SObjectField field1, SObjectField field2);
SOQL with(SObjectField field1, SObjectField field2, SObjectField field3);
SOQL with(SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4);
SOQL with(SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4, SObjectField field5);
removeWhenNull
Condition will be removed when filter's value is null.
String accountName = null;
SOQL.of(Account.SObjectType)
.whereAre(SOQL.Filter.with(Account.Name).equal(accountName).removeWhenNull())
.toList();
anyConditionMatching
You can utilize the anyConditionMatching method, which joins conditions using the OR
operator.
SOQL.of(Account.SObjectType)
.whereAre(SOQL.FilterGroup
.add(SOQL.Filter.with(Account.Name).equal('My Account'))
.add(SOQL.Filter.with(Account.NumberOfEmployees).greaterThanOrEqual(10))
.anyConditionMatching()
).toList();
Fixed Issues
Count Fix
COUNT()
must be the only element in the SELECT list, any other fields will be automatically removed.
Code Refactoring
Code is simpler, a lot of lines was removed.