Skip to content

v2.1.0

Compare
Choose a tag to compare
@pgajek2 pgajek2 released this 28 Jul 16:03
· 39 commits to main since this release
94e5b82

28-July-2023

Changes

Ignore conditions when logic evaluates to true

Instead of doing this:

public SOQL.FilterGroup getFilters(String accountName, String accountIndustry) {
      SOQL.FilterGroup group = SOQL.FilterGroup;

      if (String.isNotBlank(accountName)) {
         group.add(SOQL.Filter.name().equal(accountName));
      }
      if (String.isNotBlank(accountIndustry)) {
         group.add(SOQL.Filter.with(Account.Industry).equal(accountIndustry));
      }
      
      return group;
}

Developer can do:

SOQL.FilterGroup
   .add(SOQL.Filter.name().equal(accountName).ignoreWhen(String.isBlank(accountName)))
   .add(SOQL.Filter.with(Account.Industry).equal(accountName).ignoreWhen(String.isBlank(accountIndustry)))

Check if record exists

Instead of:

Boolean isRecordExists = SOQL.of(Account.SObjectType).byId('someId').toList() > 0;

Developer can do:

Boolean isRecordExists = SOQL.of(Account.SObjectType).byId('someId').doExist();

Delete removeWhenNull method

Method .removeWhenNull() is not longer supported and was deleted.
Developers can use .ignoreWhen(value == null) instead.