Skip to main content

QB_Condition

predefinied

id

  • WHERE Id = :accountId
  • WHERE Id IN :accountIds

Signature

QB_Condition id()

Example

QS.of(Account.sObjectType)
.whereAre(QS.Condition.id().equal(accountId))

QS.of(Account.sObjectType)
.whereAre(QS.Condition.id().isIn(accountIds))

recordTypeDeveloperName

  • WHERE RecordType.DeveloperName = 'Partner'

Signature

QB_Condition recordTypeDeveloperName()

Example

QS.of(Account.sObjectType)
.whereAre(QS.Condition.recordTypeDeveloperName().equal('Partner'))

fields

field

Specify field that should be used in the condition.

Signature

QB_Condition field(SObjectField field)

Example

QS.of(Account.sObjectType)
.whereAre(QS.Condition.field(Account.Name).equal('My Account'))

relatedField

Specify parent field that should be used in the condition.

Signature

QB_Condition relatedField(String relationshipPath, SObjectField field)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.relatedField('Account', Account.Name).equal('My Account'))

comperators

isNull

  • WHERE Industry = NULL

Signature

QB_Condition isNull()

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Industry).isNull())

isNotNull

  • WHERE Industry != NULL

Signature

QB_Condition isNotNull()

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Industry).isNotNull())

equal

  • WHERE Name = 'My Account'
  • WHERE NumberOfEmployees = 10
  • WHERE IsDeleted = true

Signature

QB_Condition equal(Object value)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Name).equal('My Account'))

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.NumberOfEmployees).equal(10))

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.IsDeleted).equal(true))

notEqual

  • WHERE Name != 'My Account'
  • WHERE NumberOfEmployees != 10
  • WHERE IsDeleted != true

Signature

QB_Condition notEqual(Object value)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Name).notEqual('My Account'))

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.NumberOfEmployees).notEqual(10))

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.IsDeleted).notEqual(true))

lessThan

  • WHERE NumberOfEmployees < 10

Signature

QB_Condition lessThan(Object value)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.NumberOfEmployees).lessThan(10))

greaterThan

  • WHERE NumberOfEmployees > 10

Signature

QB_Condition greaterThan(Object value)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.NumberOfEmployees).greaterThan(10))

lessThanOrEqual

  • WHERE NumberOfEmployees <= 10

Signature

QB_Condition lessThanOrEqual(Object value)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.NumberOfEmployees).lessThanOrEqual(10))

greaterThanOrEqual

  • WHERE NumberOfEmployees >= 10

Signature

QB_Condition greaterThanOrEqual(Object value)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.NumberOfEmployees).greaterThanOrEqual(10))

likeAnyBoth

  • WHERE Name LIKE '%My%'

Signature

QB_Condition likeAnyBoth(String value)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Name).likeAnyBoth('My'))

likeAnyLeft

  • WHERE Name LIKE '%My'

Signature

QB_Condition likeAnyLeft(String value)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Name).likeAnyLeft('My'))

likeAnyRight

  • WHERE Name LIKE 'My%'

Signature

QB_Condition likeAnyRight(String value)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Name).likeAnyRight('My'))

isIn

  • WHERE Id IN :accountIds

Signature

QB_Condition isIn(List<Object> inList)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Id).isIn(accountIds))

isNotIn

  • WHERE Id NOT IN :accountIds

Signature

QB_Condition isNotIn(List<Object> inList)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Id).notIn(accountIds))

join query

isIn

  • WHERE Id IN (SELECT AccountId FROM Contact WHERE Name = 'My Contact')

Signature

QB_Condition isIn(QB_Join joinQuery)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Id).isIn(
QS.Join.of(Contact.sObjectType)
.field(Contact.AccountId)
.whereAre(QS.Condition.field(Contact.Name).equal('My Contact'))
))

isNotIn

  • WHERE Id NOT IN (SELECT AccountId FROM Contact WHERE Name = 'My Contact')

Signature

QB_Condition isNotIn(QB_Join joinQuery)

Example

QS.of(Contact.sObjectType)
.whereAre(QS.Condition.field(Account.Id).isNotIn(
QS.Join.of(Contact.sObjectType)
.field(Contact.AccountId)
.whereAre(QS.Condition.field(Contact.Name).equal('My Contact'))
))