Skip to content

v1.0.2

Compare
Choose a tag to compare
@pgajek2 pgajek2 released this 31 May 09:05
· 98 commits to main since this release

31-May-2023

Changes

with(field1 - field5)

Make code easier to read by new with methods.

Documentation

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

Documentation

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.