Skip to content

Commit

Permalink
documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
pgajek2 committed Aug 16, 2023
1 parent 8489e15 commit 6a7e541
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions website/docs/docs/build-your-selector.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Check examples in the [repository](https://github.com/beyond-the-cloud-dev/soql-

SOQL-Lib is agile, so you can adjust the solution according to your needs. We don't force one approach over another, you can choose your own. Here are our propositions:

#### A - Inheritance - extends SOQL, implements Interface + static
## A - Inheritance - extends SOQL, implements Interface + static

```apex
public inherited sharing class SOQL_Account extends SOQL implements SOQL.Selector {
Expand Down Expand Up @@ -54,11 +54,9 @@ public with sharing class ExampleController {
@AuraEnabled
public static List<Account> getPartnerAccounts(String accountName) {
return SOQL_Account.query()
.byRecordType('Partner')
.whereAre(SOQL.Filter.name().contains(accountName))
.with(Account.BillingCity, Account.BillingCountry)
.whereAre(SOQL.FilterGroup
.add(SOQL.Filter.name().contains(accountName))
.add(SOQL.Filter.recordType().equal('Partner'))
)
.toList();
}
Expand All @@ -78,7 +76,7 @@ public with sharing class ExampleController {
}
```

#### B - Composition - implements Interface + static
## B - Composition - implements Interface + static

Use `SOQL.Selector` and create `static` methods.

Expand Down Expand Up @@ -130,7 +128,7 @@ public with sharing class ExampleController {
}
```

#### C - Inheritance - extends SOQL + non-static
## C - Inheritance - extends SOQL + non-static

```apex
public inherited sharing class SOQL_Account extends SOQL {
Expand Down Expand Up @@ -194,7 +192,7 @@ public with sharing class ExampleController {
}
```

#### D - Composition - implements Interface + non-static
## D - Composition - implements Interface + non-static

Very useful when you have different teams/streams that need different query configurations.

Expand Down Expand Up @@ -242,7 +240,7 @@ public with sharing class ExampleController {
}
```

#### E - Custom
## E - Custom

Create Selectors in your own way.

Expand Down Expand Up @@ -279,7 +277,7 @@ public with sharing class ExampleController {
}
```

#### F - FFLib Approach
## F - FFLib Approach

```apex
Expand Down

1 comment on commit 6a7e541

@vercel
Copy link

@vercel vercel bot commented on 6a7e541 Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.