From a4379278fa047e8c19002df306d567eacf81bea0 Mon Sep 17 00:00:00 2001 From: Piotr PG Gajek Date: Fri, 16 Feb 2024 16:20:36 +0100 Subject: [PATCH 1/3] API 60 Update Signed-off-by: Piotr PG Gajek --- force-app/main/default/classes/SOQL.cls | 2 -- force-app/main/default/classes/SOQL.cls-meta.xml | 2 +- force-app/main/default/classes/SOQL_Test.cls-meta.xml | 2 +- .../default/classes/example/ExampleController.cls-meta.xml | 4 ++-- .../main/default/classes/example/SOQL_Account.cls-meta.xml | 4 ++-- .../main/default/classes/example/SOQL_Contact.cls-meta.xml | 4 ++-- .../default/classes/example/SOQL_Opportunity.cls-meta.xml | 4 ++-- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/force-app/main/default/classes/SOQL.cls b/force-app/main/default/classes/SOQL.cls index 476dfcd7..c7ff7f00 100644 --- a/force-app/main/default/classes/SOQL.cls +++ b/force-app/main/default/classes/SOQL.cls @@ -232,10 +232,8 @@ public virtual inherited sharing class SOQL implements Queryable { Filter contains(String prefix, String value, String suffix); Filter notContains(String prefix, String value, String suffix); Filter isIn(Iterable iterable); - Filter isIn(List inList); Filter isIn(InnerJoin joinQuery); Filter notIn(Iterable iterable); - Filter notIn(List inList); Filter notIn(InnerJoin joinQuery); Filter includesAll(Iterable values); Filter includesSome(Iterable values); diff --git a/force-app/main/default/classes/SOQL.cls-meta.xml b/force-app/main/default/classes/SOQL.cls-meta.xml index 7a518297..f5e18fd1 100644 --- a/force-app/main/default/classes/SOQL.cls-meta.xml +++ b/force-app/main/default/classes/SOQL.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 60.0 Active diff --git a/force-app/main/default/classes/SOQL_Test.cls-meta.xml b/force-app/main/default/classes/SOQL_Test.cls-meta.xml index 7a518297..f5e18fd1 100644 --- a/force-app/main/default/classes/SOQL_Test.cls-meta.xml +++ b/force-app/main/default/classes/SOQL_Test.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 60.0 Active diff --git a/force-app/main/default/classes/example/ExampleController.cls-meta.xml b/force-app/main/default/classes/example/ExampleController.cls-meta.xml index 9bbf7b4e..f5e18fd1 100644 --- a/force-app/main/default/classes/example/ExampleController.cls-meta.xml +++ b/force-app/main/default/classes/example/ExampleController.cls-meta.xml @@ -1,5 +1,5 @@ - 56.0 + 60.0 Active - \ No newline at end of file + diff --git a/force-app/main/default/classes/example/SOQL_Account.cls-meta.xml b/force-app/main/default/classes/example/SOQL_Account.cls-meta.xml index 45cccbd4..f5e18fd1 100644 --- a/force-app/main/default/classes/example/SOQL_Account.cls-meta.xml +++ b/force-app/main/default/classes/example/SOQL_Account.cls-meta.xml @@ -1,5 +1,5 @@ - 57.0 + 60.0 Active - \ No newline at end of file + diff --git a/force-app/main/default/classes/example/SOQL_Contact.cls-meta.xml b/force-app/main/default/classes/example/SOQL_Contact.cls-meta.xml index 45cccbd4..f5e18fd1 100644 --- a/force-app/main/default/classes/example/SOQL_Contact.cls-meta.xml +++ b/force-app/main/default/classes/example/SOQL_Contact.cls-meta.xml @@ -1,5 +1,5 @@ - 57.0 + 60.0 Active - \ No newline at end of file + diff --git a/force-app/main/default/classes/example/SOQL_Opportunity.cls-meta.xml b/force-app/main/default/classes/example/SOQL_Opportunity.cls-meta.xml index 45cccbd4..f5e18fd1 100644 --- a/force-app/main/default/classes/example/SOQL_Opportunity.cls-meta.xml +++ b/force-app/main/default/classes/example/SOQL_Opportunity.cls-meta.xml @@ -1,5 +1,5 @@ - 57.0 + 60.0 Active - \ No newline at end of file + From 726a7cc641014bbc9a3259dd5ae5a8a63ba483d3 Mon Sep 17 00:00:00 2001 From: Piotr PG Gajek Date: Mon, 19 Feb 2024 16:59:42 +0100 Subject: [PATCH 2/3] null coalescing Signed-off-by: Piotr PG Gajek --- .forceignore | 3 +++ force-app/main/default/classes/SOQL.cls | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .forceignore diff --git a/.forceignore b/.forceignore new file mode 100644 index 00000000..29af63a9 --- /dev/null +++ b/.forceignore @@ -0,0 +1,3 @@ +**/jsconfig.json + +**/.eslintrc.json diff --git a/force-app/main/default/classes/SOQL.cls b/force-app/main/default/classes/SOQL.cls index c7ff7f00..ad2a2814 100644 --- a/force-app/main/default/classes/SOQL.cls +++ b/force-app/main/default/classes/SOQL.cls @@ -1454,7 +1454,7 @@ public virtual inherited sharing class SOQL implements Queryable { } private String formattedString(String value) { - return value == null ? value : value.trim(); + return value ?? value.trim(); } public Filter isIn(Iterable iterable) { From 50589cae1c70d845c335ad529ce38c076d2acf1d Mon Sep 17 00:00:00 2001 From: Piotr PG Gajek Date: Tue, 12 Mar 2024 20:56:05 +0100 Subject: [PATCH 3/3] Iterable for relationships Signed-off-by: Piotr PG Gajek --- force-app/main/default/classes/SOQL.cls | 10 +++++----- website/docs/api/soql-sub.md | 4 ++-- website/docs/api/soql.md | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/force-app/main/default/classes/SOQL.cls b/force-app/main/default/classes/SOQL.cls index ad2a2814..5a10f551 100644 --- a/force-app/main/default/classes/SOQL.cls +++ b/force-app/main/default/classes/SOQL.cls @@ -59,7 +59,7 @@ public virtual inherited sharing class SOQL implements Queryable { Queryable with(String relationshipName, SObjectField field1, SObjectField field2, SObjectField field3); Queryable with(String relationshipName, SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4); Queryable with(String relationshipName, SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4, SObjectField field5); - Queryable with(String relationshipName, List fields); + Queryable with(String relationshipName, Iterable fields); Queryable with(SubQuery subQuery); // SELECT - AGGREGATE FUNCTIONS Queryable count(); @@ -170,7 +170,7 @@ public virtual inherited sharing class SOQL implements Queryable { SubQuery with(SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4); SubQuery with(SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4, SObjectField field5); SubQuery with(List fields); - SubQuery with(String relationshipName, List fields); + SubQuery with(String relationshipName, Iterable fields); SubQuery with(SubQuery subQuery); // WHERE SubQuery whereAre(FilterGroup filterGroup); @@ -355,7 +355,7 @@ public virtual inherited sharing class SOQL implements Queryable { return with(relationshipName, new List{ field1, field2, field3, field4, field5 }); } - public SOQL with(String relationshipName, List fields) { + public SOQL with(String relationshipName, Iterable fields) { builder.fields.with(relationshipName, fields); return this; } @@ -993,7 +993,7 @@ public virtual inherited sharing class SOQL implements Queryable { fields.add('FORMAT(' + field + ') ' + alias); } - public void with(String relationshipPath, List fields) { + public void with(String relationshipPath, Iterable fields) { for (SObjectField field : fields) { with(relationshipPath, field); } @@ -1077,7 +1077,7 @@ public virtual inherited sharing class SOQL implements Queryable { return this; } - public SubQuery with(String relationshipName, List fields) { + public SubQuery with(String relationshipName, Iterable fields) { builder.fields.with(relationshipName, fields); return this; } diff --git a/website/docs/api/soql-sub.md b/website/docs/api/soql-sub.md index e266c48d..2b6c1ce7 100644 --- a/website/docs/api/soql-sub.md +++ b/website/docs/api/soql-sub.md @@ -22,7 +22,7 @@ The following are methods for `SubQuery`. - [`with(SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4)`](#with-field1---field5) - [`with(SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4, SObjectField field5)`](#with-field1---field5) - [`with(List fields)`](#with-fields) -- [`with(String relationshipName, List fields)`](#with-related-fields) +- [`with(String relationshipName, Iterable fields)`](#with-related-fields) [**SUBQUERY**](#sub-query) @@ -154,7 +154,7 @@ SOQL.of(Account.SObjectType) **Signature** ```apex -SubQuery with(String relationshipName, List fields) +SubQuery with(String relationshipName, Iterable fields) ``` diff --git a/website/docs/api/soql.md b/website/docs/api/soql.md index 2be9a58b..f4281d4d 100644 --- a/website/docs/api/soql.md +++ b/website/docs/api/soql.md @@ -30,7 +30,7 @@ The following are methods for `SOQL`. - [`with(String relationshipName, SObjectField field1, SObjectField field2, SObjectField field3)`](#with-related-field1---field5) - [`with(String relationshipName, SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4)`](#with-related-field1---field5) - [`with(String relationshipName, SObjectField field1, SObjectField field2, SObjectField field3, SObjectField field4, SObjectField field5)`](#with-related-field1---field5) -- [`with(String relationshipName, List fields)`](#with-related-fields) +- [`with(String relationshipName, Iterable fields)`](#with-related-fields) [**AGGREGATION FUNCTIONS**](#aggregate-functions) @@ -343,7 +343,7 @@ Use for more than 5 parent fields. **Signature** ```apex -Queryable with(String relationshipName, List fields) +Queryable with(String relationshipName, Iterable fields) ``` **Example**