Skip to content

QRY_Condition

Class · Group: Query Infrastructure

apex
global inherited sharing class QRY_Condition

Condition infrastructure for building complex SOQL WHERE clauses. Use these classes with QRY_Builder.addCondition() for compound conditions that cannot be expressed with the fluent API alone (e.g., grouped OR conditions).

VISIBILITY: global for subscriber access.

- Evaluable interface: base type for all conditions

- Operator enum and constants: comparison operators

- FieldCondition: field comparisons (=, !=, <, >, LIKE, etc.)

- OrCondition/AndCondition: grouping conditions

Since: 1.0

Example:

apex
QRY_Condition.Evaluable condition = new QRY_Condition.OrCondition()
    .add(new QRY_Condition.FieldCondition(Account.Industry).equals('Tech'))
    .add(new QRY_Condition.FieldCondition(Account.Industry).equals('Finance'));
List<Account> accounts = QRY_Builder.selectFrom(Account.SObjectType)
    .addCondition(condition)
    .toList();

See Also: QRY_Builder


Properties

PropertyDescription
global virtual interface EvaluableInterface for condition classes.
global interface NestableInterface for condition containers that support adding nested conditions.
global enum OperatorSOQL comparison operators used to build query conditions.
global enum UnitOfTimeUnits of time for SOQL date literals.

Inner Classes

ClassDescription
AndConditionRepresents a SOQL "AND" condition group.
DateLiteralProvides SOQL date literal values for use in QRY_Builder conditions.
FieldConditionRepresents a condition in a SOQL WHERE clause based on a specific field, operator, and value.
OrConditionRepresents a SOQL "OR" condition group.
SoqlOptionsOptions for SOQL generation.