From 1dc70115e8cc9a8e201257095124af5e59db54a4 Mon Sep 17 00:00:00 2001 From: Piotr PG Gajek Date: Sat, 26 Sep 2026 00:22:30 +0200 Subject: [PATCH 1/2] Committable spelling fix --- force-app/main/default/classes/DML.cls | 204 +++++++++--------- force-app/main/default/classes/DML_Test.cls | 4 +- package/main/default/classes/DML.cls | 204 +++++++++--------- .../main/default/classes/DML_Full_Test.cls | 4 +- todo | 2 +- website/advanced/commit-hooks.md | 4 +- website/advanced/execution-control.md | 12 +- website/advanced/logger.md | 2 +- website/advanced/shared-instance.md | 2 +- website/architecture/registration.md | 2 +- website/configuration/dml-options.md | 8 +- website/configuration/field-level-security.md | 6 +- website/configuration/sharing-mode.md | 4 +- website/dml/delete.md | 18 +- website/dml/hard-delete.md | 18 +- website/dml/insert.md | 22 +- website/dml/merge.md | 18 +- website/dml/publish.md | 8 +- website/dml/undelete.md | 18 +- website/dml/update.md | 22 +- website/dml/upsert.md | 30 +-- website/examples.md | 2 +- website/release.md | 2 +- .../3.1.0/architecture/registration.md | 2 +- .../3.1.0/configuration/dml-options.md | 6 +- .../configuration/field-level-security.md | 4 +- .../3.1.0/configuration/sharing-mode.md | 4 +- website/versions/3.1.0/dml/delete.md | 18 +- website/versions/3.1.0/dml/insert.md | 22 +- website/versions/3.1.0/dml/merge.md | 18 +- website/versions/3.1.0/dml/publish.md | 8 +- website/versions/3.1.0/dml/undelete.md | 18 +- website/versions/3.1.0/dml/update.md | 22 +- website/versions/3.1.0/dml/upsert.md | 30 +-- 34 files changed, 384 insertions(+), 384 deletions(-) diff --git a/force-app/main/default/classes/DML.cls b/force-app/main/default/classes/DML.cls index d16f524..7975a26 100644 --- a/force-app/main/default/classes/DML.cls +++ b/force-app/main/default/classes/DML.cls @@ -2,7 +2,7 @@ * Copyright (c) 2026 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev) * Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/dml-lib/blob/main/LICENSE) * - * v3.2.0 + * v4.0.0 * * PMD False Positives: * - MethodNamingConventions: Some methods are uppercase to indicate that they are "constructors" of other internal classes @@ -24,9 +24,9 @@ 'PMD.MethodNamingConventions,PMD.ApexDoc,PMD.CyclomaticComplexity,PMD.CognitiveComplexity,PMD.ExcessivePublicCount,PMD.FieldDeclarationsShouldBeAtStart,PMD.AvoidDebugStatements,PMD.OperationWithLimitsInLoop,PMD.ApexCRUDViolation,PMD.ExcessiveClassLength,PMD.NcssTypeCount,PMD.PropertyNamingConventions,PMD.FieldNamingConventions,PMD.AvoidGlobalModifier' ) @NamespaceAccessible -public inherited sharing class DML implements Commitable { +public inherited sharing class DML implements Committable { @NamespaceAccessible - public static Commitable Shared { + public static Committable Shared { get { if (Shared == null) { Shared = new DML(); @@ -57,47 +57,47 @@ public inherited sharing class DML implements Commitable { } @NamespaceAccessible - public interface Commitable { + public interface Committable { // Insert - Commitable toInsert(SObject record); - Commitable toInsert(DML.Record record); - Commitable toInsert(List records); - Commitable toInsert(DML.Records records); + Committable toInsert(SObject record); + Committable toInsert(DML.Record record); + Committable toInsert(List records); + Committable toInsert(DML.Records records); // Update - Commitable toUpdate(SObject record); - Commitable toUpdate(DML.Record record); - Commitable toUpdate(List records); - Commitable toUpdate(DML.Records records); + Committable toUpdate(SObject record); + Committable toUpdate(DML.Record record); + Committable toUpdate(List records); + Committable toUpdate(DML.Records records); // Upsert - Commitable toUpsert(SObject record); - Commitable toUpsert(SObject record, SObjectField externalIdField); - Commitable toUpsert(DML.Record record); - Commitable toUpsert(List records); - Commitable toUpsert(List records, SObjectField externalIdField); - Commitable toUpsert(DML.Records records); + Committable toUpsert(SObject record); + Committable toUpsert(SObject record, SObjectField externalIdField); + Committable toUpsert(DML.Record record); + Committable toUpsert(List records); + Committable toUpsert(List records, SObjectField externalIdField); + Committable toUpsert(DML.Records records); // Delete - Commitable toDelete(Id recordId); - Commitable toDelete(SObject record); - Commitable toDelete(Iterable recordIds); - Commitable toDelete(List records); + Committable toDelete(Id recordId); + Committable toDelete(SObject record); + Committable toDelete(Iterable recordIds); + Committable toDelete(List records); // Hard Delete - Commitable toHardDelete(Id recordId); - Commitable toHardDelete(SObject record); - Commitable toHardDelete(Iterable recordIds); - Commitable toHardDelete(List records); + Committable toHardDelete(Id recordId); + Committable toHardDelete(SObject record); + Committable toHardDelete(Iterable recordIds); + Committable toHardDelete(List records); // Undelete - Commitable toUndelete(Id recordId); - Commitable toUndelete(SObject record); - Commitable toUndelete(Iterable recordIds); - Commitable toUndelete(List records); + Committable toUndelete(Id recordId); + Committable toUndelete(SObject record); + Committable toUndelete(Iterable recordIds); + Committable toUndelete(List records); // Merge - Commitable toMerge(SObject mergeToRecord, SObject duplicatedRecord); - Commitable toMerge(SObject mergeToRecord, List duplicateRecords); - Commitable toMerge(SObject mergeToRecord, Id duplicatedRecordId); - Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); + Committable toMerge(SObject mergeToRecord, SObject duplicatedRecord); + Committable toMerge(SObject mergeToRecord, List duplicateRecords); + Committable toMerge(SObject mergeToRecord, Id duplicatedRecordId); + Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); // Platform Event - Commitable toPublish(SObject record); - Commitable toPublish(List records); + Committable toPublish(SObject record); + Committable toPublish(List records); // Immediate Insert OperationResult insertImmediately(SObject record); OperationResult insertImmediately(DML.Record record); @@ -127,24 +127,24 @@ public inherited sharing class DML implements Commitable { OperationResult publishImmediately(SObject record); OperationResult publishImmediately(List records); // Mocking - Commitable identifier(String dmlIdentifier); // used for mocking and tracking results + Committable identifier(String dmlIdentifier); // used for mocking and tracking results // Debug void preview(); // Field Level Security - Commitable userMode(); - Commitable systemMode(); - Commitable accessMode(System.AccessLevel accessMode); + Committable userMode(); + Committable systemMode(); + Committable accessMode(System.AccessLevel accessMode); // Sharing Mode - Commitable withSharing(); - Commitable withoutSharing(); + Committable withSharing(); + Committable withoutSharing(); // Other configs - Commitable allowPartialSuccess(); - Commitable skipDuplicateRules(); - Commitable includeOperationIdInErrorMessage(); - Commitable options(Database.DmlOptions options); - Commitable discardWork(); - Commitable commitHook(DML.Hook callback); - Commitable combineOnDuplicate(); + Committable allowPartialSuccess(); + Committable skipDuplicateRules(); + Committable includeOperationIdInErrorMessage(); + Committable options(Database.DmlOptions options); + Committable discardWork(); + Committable commitHook(DML.Hook callback); + Committable combineOnDuplicate(); // Save Result dryRun(); Result commitWork(); @@ -370,22 +370,22 @@ public inherited sharing class DML implements Commitable { // Insert @NamespaceAccessible - public Commitable toInsert(SObject record) { + public Committable toInsert(SObject record) { return this.toInsert(Record(record)); } @NamespaceAccessible - public Commitable toInsert(Record record) { + public Committable toInsert(Record record) { return this.register(this.getInsertOperation(record.getSObjectType()), record); } @NamespaceAccessible - public Commitable toInsert(List records) { + public Committable toInsert(List records) { return this.toInsert(Records(records)); } @NamespaceAccessible - public Commitable toInsert(Records records) { + public Committable toInsert(Records records) { return this.register(this.getInsertOperation(records.getSObjectType()), records); } @@ -416,22 +416,22 @@ public inherited sharing class DML implements Commitable { // Update @NamespaceAccessible - public Commitable toUpdate(SObject record) { + public Committable toUpdate(SObject record) { return this.toUpdate(Record(record)); } @NamespaceAccessible - public Commitable toUpdate(Record record) { + public Committable toUpdate(Record record) { return this.register(this.getUpdateOperation(record.getSObjectType()), record); } @NamespaceAccessible - public Commitable toUpdate(List records) { + public Committable toUpdate(List records) { return this.toUpdate(Records(records)); } @NamespaceAccessible - public Commitable toUpdate(Records records) { + public Committable toUpdate(Records records) { return this.register(this.getUpdateOperation(records.getSObjectType()), records); } @@ -462,33 +462,33 @@ public inherited sharing class DML implements Commitable { // Upsert @NamespaceAccessible - public Commitable toUpsert(SObject record) { + public Committable toUpsert(SObject record) { return this.toUpsert(Record(record)); } @NamespaceAccessible - public Commitable toUpsert(SObject record, SObjectField externalIdField) { + public Committable toUpsert(SObject record, SObjectField externalIdField) { return this.register(this.getUpsertOperation(record.getSObjectType()).withExternalIdField(externalIdField), Record(record)); } @NamespaceAccessible - public Commitable toUpsert(Record record) { + public Committable toUpsert(Record record) { return this.register(this.getUpsertOperation(record.getSObjectType()), record); } @NamespaceAccessible - public Commitable toUpsert(List records) { + public Committable toUpsert(List records) { return this.toUpsert(Records(records)); } @NamespaceAccessible - public Commitable toUpsert(List records, SObjectField externalIdField) { + public Committable toUpsert(List records, SObjectField externalIdField) { Records dmlRecords = Records(records); return this.register(this.getUpsertOperation(dmlRecords.getSObjectType()).withExternalIdField(externalIdField), dmlRecords); } @NamespaceAccessible - public Commitable toUpsert(Records records) { + public Committable toUpsert(Records records) { return this.register(this.getUpsertOperation(records.getSObjectType()), records); } @@ -519,30 +519,30 @@ public inherited sharing class DML implements Commitable { // Delete @NamespaceAccessible - public Commitable toDelete(Id recordId) { + public Committable toDelete(Id recordId) { return this.toDelete(Record(recordId)); } @NamespaceAccessible - public Commitable toDelete(SObject record) { + public Committable toDelete(SObject record) { return this.toDelete(Record(record)); } - private Commitable toDelete(Record record) { + private Committable toDelete(Record record) { return this.register(this.getDeleteOperation(record.getSObjectType()), record); } @NamespaceAccessible - public Commitable toDelete(Iterable recordIds) { + public Committable toDelete(Iterable recordIds) { return this.toDelete(Records(recordIds)); } @NamespaceAccessible - public Commitable toDelete(List records) { + public Committable toDelete(List records) { return this.toDelete(Records(records)); } - private Commitable toDelete(Records records) { + private Committable toDelete(Records records) { return this.register(this.getDeleteOperation(records.getSObjectType()), records); } @@ -581,25 +581,25 @@ public inherited sharing class DML implements Commitable { // Hard Delete @NamespaceAccessible - public Commitable toHardDelete(Id recordId) { + public Committable toHardDelete(Id recordId) { Record dmlRecord = Record(recordId); return this.register(this.getDeleteOperation(dmlRecord.getSObjectType()).withHardDelete(), dmlRecord); } @NamespaceAccessible - public Commitable toHardDelete(SObject record) { + public Committable toHardDelete(SObject record) { Record dmlRecord = Record(record); return this.register(this.getDeleteOperation(dmlRecord.getSObjectType()).withHardDelete(), dmlRecord); } @NamespaceAccessible - public Commitable toHardDelete(Iterable recordIds) { + public Committable toHardDelete(Iterable recordIds) { Records dmlRecords = Records(recordIds); return this.register(this.getDeleteOperation(dmlRecords.getSObjectType()).withHardDelete(), dmlRecords); } @NamespaceAccessible - public Commitable toHardDelete(List records) { + public Committable toHardDelete(List records) { Records dmlRecords = Records(records); return this.register(this.getDeleteOperation(dmlRecords.getSObjectType()).withHardDelete(), dmlRecords); } @@ -607,30 +607,30 @@ public inherited sharing class DML implements Commitable { // Undelete @NamespaceAccessible - public Commitable toUndelete(Id recordId) { + public Committable toUndelete(Id recordId) { return this.toUndelete(Record(recordId)); } @NamespaceAccessible - public Commitable toUndelete(SObject record) { + public Committable toUndelete(SObject record) { return this.toUndelete(Record(record)); } - private Commitable toUndelete(Record record) { + private Committable toUndelete(Record record) { return this.register(this.getUndeleteOperation(record.getSObjectType()), record); } @NamespaceAccessible - public Commitable toUndelete(Iterable recordIds) { + public Committable toUndelete(Iterable recordIds) { return this.toUndelete(Records(recordIds)); } @NamespaceAccessible - public Commitable toUndelete(List records) { + public Committable toUndelete(List records) { return this.toUndelete(Records(records)); } - private Commitable toUndelete(Records records) { + private Committable toUndelete(Records records) { return this.register(this.getUndeleteOperation(records.getSObjectType()), records); } @@ -669,34 +669,34 @@ public inherited sharing class DML implements Commitable { // Merge @NamespaceAccessible - public Commitable toMerge(SObject mergeToRecord, SObject duplicatedRecord) { + public Committable toMerge(SObject mergeToRecord, SObject duplicatedRecord) { Record dmlMergeToRecord = Record(mergeToRecord); return this.toMerge(this.getMergeOperation(dmlMergeToRecord.getSObjectType(), dmlMergeToRecord), Record(duplicatedRecord)); } @NamespaceAccessible - public Commitable toMerge(SObject mergeToRecord, Id duplicatedRecordId) { + public Committable toMerge(SObject mergeToRecord, Id duplicatedRecordId) { Record dmlMergeToRecord = Record(mergeToRecord); return this.toMerge(this.getMergeOperation(dmlMergeToRecord.getSObjectType(), dmlMergeToRecord), Record(duplicatedRecordId)); } - private Commitable toMerge(MergeOperation mergeOperation, Record duplicatedRecord) { + private Committable toMerge(MergeOperation mergeOperation, Record duplicatedRecord) { return this.register(mergeOperation, duplicatedRecord); } @NamespaceAccessible - public Commitable toMerge(SObject mergeToRecord, List duplicateRecords) { + public Committable toMerge(SObject mergeToRecord, List duplicateRecords) { Record dmlMergeToRecord = Record(mergeToRecord); return this.toMerge(this.getMergeOperation(dmlMergeToRecord.getSObjectType(), dmlMergeToRecord), Records(duplicateRecords)); } @NamespaceAccessible - public Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds) { + public Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds) { Record dmlMergeToRecord = Record(mergeToRecord); return this.toMerge(this.getMergeOperation(dmlMergeToRecord.getSObjectType(), dmlMergeToRecord), Records(duplicatedRecordIds)); } - private Commitable toMerge(MergeOperation mergeOperation, Records duplicateRecords) { + private Committable toMerge(MergeOperation mergeOperation, Records duplicateRecords) { return this.register(mergeOperation, duplicateRecords); } @@ -707,13 +707,13 @@ public inherited sharing class DML implements Commitable { // Platform Event @NamespaceAccessible - public Commitable toPublish(SObject record) { + public Committable toPublish(SObject record) { Record dmlRecord = Record(record); return this.register(this.getPlatformEventOperation(dmlRecord.getSObjectType()), dmlRecord); } @NamespaceAccessible - public Commitable toPublish(List records) { + public Committable toPublish(List records) { Records dmlRecords = Records(records); return this.register(this.getPlatformEventOperation(dmlRecords.getSObjectType()), dmlRecords); } @@ -750,12 +750,12 @@ public inherited sharing class DML implements Commitable { return result; } - private Commitable register(DmlOperation operation, Record record) { + private Committable register(DmlOperation operation, Record record) { this.orchestrator.register(this.operationsStorage.getOrRegister(operation), record); return this; } - private Commitable register(DmlOperation operation, Records records) { + private Committable register(DmlOperation operation, Records records) { this.orchestrator.register(this.operationsStorage.getOrRegister(operation), records); return this; } @@ -763,7 +763,7 @@ public inherited sharing class DML implements Commitable { // Identifier @NamespaceAccessible - public Commitable identifier(String dmlIdentifier) { + public Committable identifier(String dmlIdentifier) { this.configuration.identifier(dmlIdentifier); return this; } @@ -778,17 +778,17 @@ public inherited sharing class DML implements Commitable { // Field Level Security @NamespaceAccessible - public Commitable userMode() { + public Committable userMode() { return this.accessMode(System.AccessLevel.USER_MODE); } @NamespaceAccessible - public Commitable systemMode() { + public Committable systemMode() { return this.accessMode(System.AccessLevel.SYSTEM_MODE); } @NamespaceAccessible - public Commitable accessMode(System.AccessLevel accessMode) { + public Committable accessMode(System.AccessLevel accessMode) { this.configuration.accessMode(accessMode); return this; } @@ -796,13 +796,13 @@ public inherited sharing class DML implements Commitable { // Sharing Mode @NamespaceAccessible - public Commitable withSharing() { + public Committable withSharing() { this.configuration.withSharing(); return this; } @NamespaceAccessible - public Commitable withoutSharing() { + public Committable withoutSharing() { this.configuration.withoutSharing(); return this; } @@ -810,37 +810,37 @@ public inherited sharing class DML implements Commitable { // Other configs @NamespaceAccessible - public Commitable allowPartialSuccess() { + public Committable allowPartialSuccess() { this.configuration.allowPartialSuccess(); return this; } @NamespaceAccessible - public Commitable skipDuplicateRules() { + public Committable skipDuplicateRules() { this.configuration.skipDuplicateRules(); return this; } @NamespaceAccessible - public Commitable includeOperationIdInErrorMessage() { + public Committable includeOperationIdInErrorMessage() { this.configuration.includeOperationIdInErrorMessage(); return this; } @NamespaceAccessible - public Commitable combineOnDuplicate() { + public Committable combineOnDuplicate() { this.configuration.combineOnDuplicate(); return this; } @NamespaceAccessible - public Commitable options(Database.DmlOptions options) { + public Committable options(Database.DmlOptions options) { this.configuration.options(options); return this; } @NamespaceAccessible - public Commitable discardWork() { + public Committable discardWork() { this.reset(); return this; } @@ -848,7 +848,7 @@ public inherited sharing class DML implements Commitable { // Hooks @NamespaceAccessible - public Commitable commitHook(Hook callback) { + public Committable commitHook(Hook callback) { this.hook = callback; return this; } diff --git a/force-app/main/default/classes/DML_Test.cls b/force-app/main/default/classes/DML_Test.cls index 7a73452..5bdbbb7 100644 --- a/force-app/main/default/classes/DML_Test.cls +++ b/force-app/main/default/classes/DML_Test.cls @@ -2,7 +2,7 @@ * Copyright (c) 2026 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev) * Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/dml-lib/blob/main/LICENSE) * - * v3.2.0 + * v4.0.0 * * PMD False Positives: * - CyclomaticComplexity: It is a library and we tried to put everything into ONE class @@ -4007,7 +4007,7 @@ private class DML_Test { // Test Test.startTest(); - DML.Commitable db = new DML().identifier('dmlMockId'); + DML.Committable db = new DML().identifier('dmlMockId'); db.insertImmediately(account1); db.toInsert(account2).commitWork(); diff --git a/package/main/default/classes/DML.cls b/package/main/default/classes/DML.cls index bd2cd8c..02f6c10 100644 --- a/package/main/default/classes/DML.cls +++ b/package/main/default/classes/DML.cls @@ -2,7 +2,7 @@ * Copyright (c) 2026 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev) * Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/dml-lib/blob/main/LICENSE) * - * v3.2.0 + * v4.0.0 * * PMD False Positives: * - MethodNamingConventions: Some methods are uppercase to indicate that they are "constructors" of other internal classes @@ -23,8 +23,8 @@ @SuppressWarnings( 'PMD.MethodNamingConventions,PMD.ApexDoc,PMD.CyclomaticComplexity,PMD.CognitiveComplexity,PMD.ExcessivePublicCount,PMD.FieldDeclarationsShouldBeAtStart,PMD.AvoidDebugStatements,PMD.OperationWithLimitsInLoop,PMD.ApexCRUDViolation,PMD.ExcessiveClassLength,PMD.NcssTypeCount,PMD.PropertyNamingConventions,PMD.FieldNamingConventions,PMD.AvoidGlobalModifier' ) -global inherited sharing class DML implements Commitable { - global static Commitable Shared { +global inherited sharing class DML implements Committable { + global static Committable Shared { get { if (Shared == null) { Shared = new DML(); @@ -50,47 +50,47 @@ global inherited sharing class DML implements Commitable { return new DmlRecords(recordIds); } - global interface Commitable { + global interface Committable { // Insert - Commitable toInsert(SObject record); - Commitable toInsert(DML.Record record); - Commitable toInsert(List records); - Commitable toInsert(DML.Records records); + Committable toInsert(SObject record); + Committable toInsert(DML.Record record); + Committable toInsert(List records); + Committable toInsert(DML.Records records); // Update - Commitable toUpdate(SObject record); - Commitable toUpdate(DML.Record record); - Commitable toUpdate(List records); - Commitable toUpdate(DML.Records records); + Committable toUpdate(SObject record); + Committable toUpdate(DML.Record record); + Committable toUpdate(List records); + Committable toUpdate(DML.Records records); // Upsert - Commitable toUpsert(SObject record); - Commitable toUpsert(SObject record, SObjectField externalIdField); - Commitable toUpsert(DML.Record record); - Commitable toUpsert(List records); - Commitable toUpsert(List records, SObjectField externalIdField); - Commitable toUpsert(DML.Records records); + Committable toUpsert(SObject record); + Committable toUpsert(SObject record, SObjectField externalIdField); + Committable toUpsert(DML.Record record); + Committable toUpsert(List records); + Committable toUpsert(List records, SObjectField externalIdField); + Committable toUpsert(DML.Records records); // Delete - Commitable toDelete(Id recordId); - Commitable toDelete(SObject record); - Commitable toDelete(Iterable recordIds); - Commitable toDelete(List records); + Committable toDelete(Id recordId); + Committable toDelete(SObject record); + Committable toDelete(Iterable recordIds); + Committable toDelete(List records); // Hard Delete - Commitable toHardDelete(Id recordId); - Commitable toHardDelete(SObject record); - Commitable toHardDelete(Iterable recordIds); - Commitable toHardDelete(List records); + Committable toHardDelete(Id recordId); + Committable toHardDelete(SObject record); + Committable toHardDelete(Iterable recordIds); + Committable toHardDelete(List records); // Undelete - Commitable toUndelete(Id recordId); - Commitable toUndelete(SObject record); - Commitable toUndelete(Iterable recordIds); - Commitable toUndelete(List records); + Committable toUndelete(Id recordId); + Committable toUndelete(SObject record); + Committable toUndelete(Iterable recordIds); + Committable toUndelete(List records); // Merge - Commitable toMerge(SObject mergeToRecord, SObject duplicatedRecord); - Commitable toMerge(SObject mergeToRecord, List duplicateRecords); - Commitable toMerge(SObject mergeToRecord, Id duplicatedRecordId); - Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); + Committable toMerge(SObject mergeToRecord, SObject duplicatedRecord); + Committable toMerge(SObject mergeToRecord, List duplicateRecords); + Committable toMerge(SObject mergeToRecord, Id duplicatedRecordId); + Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); // Platform Event - Commitable toPublish(SObject record); - Commitable toPublish(List records); + Committable toPublish(SObject record); + Committable toPublish(List records); // Immediate Insert OperationResult insertImmediately(SObject record); OperationResult insertImmediately(DML.Record record); @@ -120,24 +120,24 @@ global inherited sharing class DML implements Commitable { OperationResult publishImmediately(SObject record); OperationResult publishImmediately(List records); // Mocking - Commitable identifier(String dmlIdentifier); // used for mocking and tracking results + Committable identifier(String dmlIdentifier); // used for mocking and tracking results // Debug void preview(); // Field Level Security - Commitable userMode(); - Commitable systemMode(); - Commitable accessMode(System.AccessLevel accessMode); + Committable userMode(); + Committable systemMode(); + Committable accessMode(System.AccessLevel accessMode); // Sharing Mode - Commitable withSharing(); - Commitable withoutSharing(); + Committable withSharing(); + Committable withoutSharing(); // Other configs - Commitable allowPartialSuccess(); - Commitable skipDuplicateRules(); - Commitable includeOperationIdInErrorMessage(); - Commitable options(Database.DmlOptions options); - Commitable discardWork(); - Commitable commitHook(DML.Hook callback); - Commitable combineOnDuplicate(); + Committable allowPartialSuccess(); + Committable skipDuplicateRules(); + Committable includeOperationIdInErrorMessage(); + Committable options(Database.DmlOptions options); + Committable discardWork(); + Committable commitHook(DML.Hook callback); + Committable combineOnDuplicate(); // Save Result dryRun(); Result commitWork(); @@ -348,19 +348,19 @@ global inherited sharing class DML implements Commitable { // Insert - global Commitable toInsert(SObject record) { + global Committable toInsert(SObject record) { return this.toInsert(Record(record)); } - global Commitable toInsert(Record record) { + global Committable toInsert(Record record) { return this.register(this.getInsertOperation(record.getSObjectType()), record); } - global Commitable toInsert(List records) { + global Committable toInsert(List records) { return this.toInsert(Records(records)); } - global Commitable toInsert(Records records) { + global Committable toInsert(Records records) { return this.register(this.getInsertOperation(records.getSObjectType()), records); } @@ -386,19 +386,19 @@ global inherited sharing class DML implements Commitable { // Update - global Commitable toUpdate(SObject record) { + global Committable toUpdate(SObject record) { return this.toUpdate(Record(record)); } - global Commitable toUpdate(Record record) { + global Committable toUpdate(Record record) { return this.register(this.getUpdateOperation(record.getSObjectType()), record); } - global Commitable toUpdate(List records) { + global Committable toUpdate(List records) { return this.toUpdate(Records(records)); } - global Commitable toUpdate(Records records) { + global Committable toUpdate(Records records) { return this.register(this.getUpdateOperation(records.getSObjectType()), records); } @@ -424,28 +424,28 @@ global inherited sharing class DML implements Commitable { // Upsert - global Commitable toUpsert(SObject record) { + global Committable toUpsert(SObject record) { return this.toUpsert(Record(record)); } - global Commitable toUpsert(SObject record, SObjectField externalIdField) { + global Committable toUpsert(SObject record, SObjectField externalIdField) { return this.register(this.getUpsertOperation(record.getSObjectType()).withExternalIdField(externalIdField), Record(record)); } - global Commitable toUpsert(Record record) { + global Committable toUpsert(Record record) { return this.register(this.getUpsertOperation(record.getSObjectType()), record); } - global Commitable toUpsert(List records) { + global Committable toUpsert(List records) { return this.toUpsert(Records(records)); } - global Commitable toUpsert(List records, SObjectField externalIdField) { + global Committable toUpsert(List records, SObjectField externalIdField) { Records dmlRecords = Records(records); return this.register(this.getUpsertOperation(dmlRecords.getSObjectType()).withExternalIdField(externalIdField), dmlRecords); } - global Commitable toUpsert(Records records) { + global Committable toUpsert(Records records) { return this.register(this.getUpsertOperation(records.getSObjectType()), records); } @@ -471,27 +471,27 @@ global inherited sharing class DML implements Commitable { // Delete - global Commitable toDelete(Id recordId) { + global Committable toDelete(Id recordId) { return this.toDelete(Record(recordId)); } - global Commitable toDelete(SObject record) { + global Committable toDelete(SObject record) { return this.toDelete(Record(record)); } - private Commitable toDelete(Record record) { + private Committable toDelete(Record record) { return this.register(this.getDeleteOperation(record.getSObjectType()), record); } - global Commitable toDelete(Iterable recordIds) { + global Committable toDelete(Iterable recordIds) { return this.toDelete(Records(recordIds)); } - global Commitable toDelete(List records) { + global Committable toDelete(List records) { return this.toDelete(Records(records)); } - private Commitable toDelete(Records records) { + private Committable toDelete(Records records) { return this.register(this.getDeleteOperation(records.getSObjectType()), records); } @@ -525,49 +525,49 @@ global inherited sharing class DML implements Commitable { // Hard Delete - global Commitable toHardDelete(Id recordId) { + global Committable toHardDelete(Id recordId) { Record dmlRecord = Record(recordId); return this.register(this.getDeleteOperation(dmlRecord.getSObjectType()).withHardDelete(), dmlRecord); } - global Commitable toHardDelete(SObject record) { + global Committable toHardDelete(SObject record) { Record dmlRecord = Record(record); return this.register(this.getDeleteOperation(dmlRecord.getSObjectType()).withHardDelete(), dmlRecord); } - global Commitable toHardDelete(Iterable recordIds) { + global Committable toHardDelete(Iterable recordIds) { Records dmlRecords = Records(recordIds); return this.register(this.getDeleteOperation(dmlRecords.getSObjectType()).withHardDelete(), dmlRecords); } - global Commitable toHardDelete(List records) { + global Committable toHardDelete(List records) { Records dmlRecords = Records(records); return this.register(this.getDeleteOperation(dmlRecords.getSObjectType()).withHardDelete(), dmlRecords); } // Undelete - global Commitable toUndelete(Id recordId) { + global Committable toUndelete(Id recordId) { return this.toUndelete(Record(recordId)); } - global Commitable toUndelete(SObject record) { + global Committable toUndelete(SObject record) { return this.toUndelete(Record(record)); } - private Commitable toUndelete(Record record) { + private Committable toUndelete(Record record) { return this.register(this.getUndeleteOperation(record.getSObjectType()), record); } - global Commitable toUndelete(Iterable recordIds) { + global Committable toUndelete(Iterable recordIds) { return this.toUndelete(Records(recordIds)); } - global Commitable toUndelete(List records) { + global Committable toUndelete(List records) { return this.toUndelete(Records(records)); } - private Commitable toUndelete(Records records) { + private Committable toUndelete(Records records) { return this.register(this.getUndeleteOperation(records.getSObjectType()), records); } @@ -601,31 +601,31 @@ global inherited sharing class DML implements Commitable { // Merge - global Commitable toMerge(SObject mergeToRecord, SObject duplicatedRecord) { + global Committable toMerge(SObject mergeToRecord, SObject duplicatedRecord) { Record dmlMergeToRecord = Record(mergeToRecord); return this.toMerge(this.getMergeOperation(dmlMergeToRecord.getSObjectType(), dmlMergeToRecord), Record(duplicatedRecord)); } - global Commitable toMerge(SObject mergeToRecord, Id duplicatedRecordId) { + global Committable toMerge(SObject mergeToRecord, Id duplicatedRecordId) { Record dmlMergeToRecord = Record(mergeToRecord); return this.toMerge(this.getMergeOperation(dmlMergeToRecord.getSObjectType(), dmlMergeToRecord), Record(duplicatedRecordId)); } - private Commitable toMerge(MergeOperation mergeOperation, Record duplicatedRecord) { + private Committable toMerge(MergeOperation mergeOperation, Record duplicatedRecord) { return this.register(mergeOperation, duplicatedRecord); } - global Commitable toMerge(SObject mergeToRecord, List duplicateRecords) { + global Committable toMerge(SObject mergeToRecord, List duplicateRecords) { Record dmlMergeToRecord = Record(mergeToRecord); return this.toMerge(this.getMergeOperation(dmlMergeToRecord.getSObjectType(), dmlMergeToRecord), Records(duplicateRecords)); } - global Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds) { + global Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds) { Record dmlMergeToRecord = Record(mergeToRecord); return this.toMerge(this.getMergeOperation(dmlMergeToRecord.getSObjectType(), dmlMergeToRecord), Records(duplicatedRecordIds)); } - private Commitable toMerge(MergeOperation mergeOperation, Records duplicateRecords) { + private Committable toMerge(MergeOperation mergeOperation, Records duplicateRecords) { return this.register(mergeOperation, duplicateRecords); } @@ -635,12 +635,12 @@ global inherited sharing class DML implements Commitable { // Platform Event - global Commitable toPublish(SObject record) { + global Committable toPublish(SObject record) { Record dmlRecord = Record(record); return this.register(this.getPlatformEventOperation(dmlRecord.getSObjectType()), dmlRecord); } - global Commitable toPublish(List records) { + global Committable toPublish(List records) { Records dmlRecords = Records(records); return this.register(this.getPlatformEventOperation(dmlRecords.getSObjectType()), dmlRecords); } @@ -675,19 +675,19 @@ global inherited sharing class DML implements Commitable { return result; } - private Commitable register(DmlOperation operation, Record record) { + private Committable register(DmlOperation operation, Record record) { this.orchestrator.register(this.operationsStorage.getOrRegister(operation), record); return this; } - private Commitable register(DmlOperation operation, Records records) { + private Committable register(DmlOperation operation, Records records) { this.orchestrator.register(this.operationsStorage.getOrRegister(operation), records); return this; } // Identifier - global Commitable identifier(String dmlIdentifier) { + global Committable identifier(String dmlIdentifier) { this.configuration.identifier(dmlIdentifier); return this; } @@ -700,66 +700,66 @@ global inherited sharing class DML implements Commitable { // Field Level Security - global Commitable userMode() { + global Committable userMode() { return this.accessMode(System.AccessLevel.USER_MODE); } - global Commitable systemMode() { + global Committable systemMode() { return this.accessMode(System.AccessLevel.SYSTEM_MODE); } - global Commitable accessMode(System.AccessLevel accessMode) { + global Committable accessMode(System.AccessLevel accessMode) { this.configuration.accessMode(accessMode); return this; } // Sharing Mode - global Commitable withSharing() { + global Committable withSharing() { this.configuration.withSharing(); return this; } - global Commitable withoutSharing() { + global Committable withoutSharing() { this.configuration.withoutSharing(); return this; } // Other configs - global Commitable allowPartialSuccess() { + global Committable allowPartialSuccess() { this.configuration.allowPartialSuccess(); return this; } - global Commitable skipDuplicateRules() { + global Committable skipDuplicateRules() { this.configuration.skipDuplicateRules(); return this; } - global Commitable includeOperationIdInErrorMessage() { + global Committable includeOperationIdInErrorMessage() { this.configuration.includeOperationIdInErrorMessage(); return this; } - global Commitable combineOnDuplicate() { + global Committable combineOnDuplicate() { this.configuration.combineOnDuplicate(); return this; } - global Commitable options(Database.DmlOptions options) { + global Committable options(Database.DmlOptions options) { this.configuration.options(options); return this; } - global Commitable discardWork() { + global Committable discardWork() { this.reset(); return this; } // Hooks - global Commitable commitHook(Hook callback) { + global Committable commitHook(Hook callback) { this.hook = callback; return this; } diff --git a/package/main/default/classes/DML_Full_Test.cls b/package/main/default/classes/DML_Full_Test.cls index d00a129..ae8d328 100644 --- a/package/main/default/classes/DML_Full_Test.cls +++ b/package/main/default/classes/DML_Full_Test.cls @@ -2,7 +2,7 @@ * Copyright (c) 2026 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev) * Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/dml-lib/blob/main/LICENSE) * - * v3.2.0 + * v4.0.0 * * PMD False Positives: * - CyclomaticComplexity: It is a library and we tried to put everything into ONE class @@ -8436,7 +8436,7 @@ private class DML_Full_Test { // Test Test.startTest(); - DML.Commitable db = new DML().identifier('dmlMockId'); + DML.Committable db = new DML().identifier('dmlMockId'); db.insertImmediately(account1); db.toInsert(account2).commitWork(); diff --git a/todo b/todo index bcbf78a..30a3a0a 100644 --- a/todo +++ b/todo @@ -126,7 +126,7 @@ DML dml = new DML(); dml.toInsert(record); -DML.Commitable db = new DML(); +DML.Committable db = new DML(); ``` diff --git a/website/advanced/commit-hooks.md b/website/advanced/commit-hooks.md index 4996da6..2bcf33e 100644 --- a/website/advanced/commit-hooks.md +++ b/website/advanced/commit-hooks.md @@ -56,7 +56,7 @@ Register a hook on the DML instance. **Signature** ```apex -Commitable commitHook(DML.Hook callback); +Committable commitHook(DML.Hook callback); ``` **Standard DML** @@ -117,7 +117,7 @@ The hook is part of the instance configuration, not registered work. It survives **Example** ```apex -DML.Commitable dml = new DML().commitHook(new CommitLogger()); +DML.Committable dml = new DML().commitHook(new CommitLogger()); dml.toInsert(accounts) .commitWork(); // hook fires diff --git a/website/advanced/execution-control.md b/website/advanced/execution-control.md index feb1e64..b190f32 100644 --- a/website/advanced/execution-control.md +++ b/website/advanced/execution-control.md @@ -9,7 +9,7 @@ Control the lifecycle of a unit of work — discard registered operations before **Example** ```apex -DML.Commitable unitOfWork = new DML() +DML.Committable unitOfWork = new DML() .toInsert(account) .toInsert(contact) .systemMode(); @@ -28,7 +28,7 @@ Drop all registered but uncommitted operations without executing any DML. **Signature** ```apex -Commitable discardWork(); +Committable discardWork(); ``` `discardWork()` clears only the queued work — the configuration (access mode, sharing mode, DML options, identifier, and commit hook) is kept. Calling `commitWork()` after `discardWork()` executes nothing, consumes zero DML statements, and returns an empty `Result`. @@ -48,7 +48,7 @@ if (isAccountEligible) { **DML Lib** ```apex -DML.Commitable unitOfWork = new DML() +DML.Committable unitOfWork = new DML() .toInsert(new Account(Name = 'Acme')) .toInsert(new Account(Name = 'Globex')); @@ -70,7 +70,7 @@ Only the registered operations are discarded. The same instance can be reused wi **Example** ```apex -DML.Commitable unitOfWork = new DML() +DML.Committable unitOfWork = new DML() .toInsert(invalidAccount) .systemMode() .allowPartialSuccess(); @@ -97,7 +97,7 @@ void preview(); **Example** ```apex -DML.Commitable unitOfWork = new DML() +DML.Committable unitOfWork = new DML() .toInsert(account) .systemMode(); @@ -110,7 +110,7 @@ unitOfWork.commitWork(); ::: ::: warning -`preview()` returns `void`, so it cannot be chained in the middle of a fluent call. Hold the `DML.Commitable` instance in a variable, call `preview()`, then continue with `commitWork()`. +`preview()` returns `void`, so it cannot be chained in the middle of a fluent call. Hold the `DML.Committable` instance in a variable, call `preview()`, then continue with `commitWork()`. ::: ::: info diff --git a/website/advanced/logger.md b/website/advanced/logger.md index 9ba0e74..54ad01b 100644 --- a/website/advanced/logger.md +++ b/website/advanced/logger.md @@ -77,7 +77,7 @@ It is generated per operation and carries no information about the records, so i **Signature** ```apex -Commitable includeOperationIdInErrorMessage(); +Committable includeOperationIdInErrorMessage(); ``` **Example** diff --git a/website/advanced/shared-instance.md b/website/advanced/shared-instance.md index ced3cad..273579c 100644 --- a/website/advanced/shared-instance.md +++ b/website/advanced/shared-instance.md @@ -55,7 +55,7 @@ A lazily-initialized, transaction-wide singleton `DML` instance. It supports the **Signature** ```apex -public static Commitable Shared { get; } +public static Committable Shared { get; } ``` Because every class in the transaction sees the same instance, work registered from different places is bulkified together and committed in minimal DML statements. diff --git a/website/architecture/registration.md b/website/architecture/registration.md index ea701d4..4998949 100644 --- a/website/architecture/registration.md +++ b/website/architecture/registration.md @@ -48,7 +48,7 @@ Use `combineOnDuplicate()` to automatically merge duplicate registrations into a **Signature** ```apex -Commitable combineOnDuplicate(); +Committable combineOnDuplicate(); ``` **Example** diff --git a/website/configuration/dml-options.md b/website/configuration/dml-options.md index a2558ee..01a5352 100644 --- a/website/configuration/dml-options.md +++ b/website/configuration/dml-options.md @@ -31,7 +31,7 @@ Allow some records to succeed while others fail, without rolling back the entire **Signature** ```apex -Commitable allowPartialSuccess(); +Committable allowPartialSuccess(); ``` **Standard DML** @@ -106,7 +106,7 @@ Skip duplicate rule evaluation during DML operations. **Signature** ```apex -Commitable skipDuplicateRules(); +Committable skipDuplicateRules(); ``` **Standard DML** @@ -149,7 +149,7 @@ Provide custom `Database.DmlOptions` for fine-grained control over DML behavior. **Signature** ```apex -Commitable options(Database.DmlOptions options); +Committable options(Database.DmlOptions options); ``` **Standard DML** @@ -240,7 +240,7 @@ Append the operation's [Error ID](/advanced/logger#error-id) to the thrown `DmlE **Signature** ```apex -Commitable includeOperationIdInErrorMessage(); +Committable includeOperationIdInErrorMessage(); ``` **Example** diff --git a/website/configuration/field-level-security.md b/website/configuration/field-level-security.md index 92db837..e9ef343 100644 --- a/website/configuration/field-level-security.md +++ b/website/configuration/field-level-security.md @@ -24,7 +24,7 @@ Set access mode explicitly using the Salesforce `System.AccessLevel` enum. **Signature** ```apex -Commitable accessMode(System.AccessLevel accessMode); +Committable accessMode(System.AccessLevel accessMode); ``` Use `accessMode(System.AccessLevel.USER_MODE)` as an alternative to `userMode()`, and `accessMode(System.AccessLevel.SYSTEM_MODE)` as an alternative to `systemMode()`. @@ -57,7 +57,7 @@ Execute DML operations respecting user permissions. This is the **default behavi **Signature** ```apex -Commitable userMode(); +Committable userMode(); ``` **Standard DML** @@ -82,7 +82,7 @@ Execute DML operations bypassing user permissions. Use this when you need to per **Signature** ```apex -Commitable systemMode(); +Committable systemMode(); ``` **Standard DML** diff --git a/website/configuration/sharing-mode.md b/website/configuration/sharing-mode.md index 339b2a8..470ede3 100644 --- a/website/configuration/sharing-mode.md +++ b/website/configuration/sharing-mode.md @@ -49,7 +49,7 @@ Execute DML operations enforcing sharing rules. Records the user doesn't have ac **Signature** ```apex -Commitable withSharing(); +Committable withSharing(); ``` **Standard DML** @@ -81,7 +81,7 @@ To use `.withoutSharing()`, `.systemMode()` or `.accessMode(System.AccessLevel.S **Signature** ```apex -Commitable withoutSharing(); +Committable withoutSharing(); ``` **Standard DML** diff --git a/website/dml/delete.md b/website/dml/delete.md index 123762e..ac566b8 100644 --- a/website/dml/delete.md +++ b/website/dml/delete.md @@ -29,10 +29,10 @@ Register records for deletion. The actual DML is executed when `commitWork()` is **Signature** ```apex -Commitable toDelete(Id recordId); -Commitable toDelete(SObject record); -Commitable toDelete(Iterable recordIds); -Commitable toDelete(List records); +Committable toDelete(Id recordId); +Committable toDelete(SObject record); +Committable toDelete(Iterable recordIds); +Committable toDelete(List records); ``` ### Single Record @@ -40,7 +40,7 @@ Commitable toDelete(List records); **Signature** ```apex -Commitable toDelete(SObject record); +Committable toDelete(SObject record); ``` **Standard DML** @@ -67,7 +67,7 @@ Delete using a record ID directly. **Signature** ```apex -Commitable toDelete(Id recordId); +Committable toDelete(Id recordId); ``` **Standard DML** @@ -92,8 +92,8 @@ new DML() **Signature** ```apex -Commitable toDelete(List records); -Commitable toDelete(Iterable recordIds); +Committable toDelete(List records); +Committable toDelete(Iterable recordIds); ``` **Standard DML** @@ -120,7 +120,7 @@ Delete using a collection of record IDs. **Signature** ```apex -Commitable toDelete(Iterable recordIds); +Committable toDelete(Iterable recordIds); ``` **Standard DML** diff --git a/website/dml/hard-delete.md b/website/dml/hard-delete.md index a36ca36..faee76d 100644 --- a/website/dml/hard-delete.md +++ b/website/dml/hard-delete.md @@ -29,10 +29,10 @@ Register records for hard deletion. The actual DML is executed when `commitWork( **Signature** ```apex -Commitable toHardDelete(Id recordId); -Commitable toHardDelete(SObject record); -Commitable toHardDelete(Iterable recordIds); -Commitable toHardDelete(List records); +Committable toHardDelete(Id recordId); +Committable toHardDelete(SObject record); +Committable toHardDelete(Iterable recordIds); +Committable toHardDelete(List records); ``` Records registered with `toHardDelete` must have an Id by the time the operation executes — otherwise a `DmlException` with the message `Only existing records can be registered as deleted.` is thrown when `commitWork()` runs. A record inserted earlier in the same unit of work receives its Id from the insert, so it can be registered for hard delete in the same commit. Operations that executed earlier in the same `commitWork()` are not rolled back when the exception is thrown — use `commitTransaction()` when the whole unit of work must be atomic (see [Deferred Validation](/architecture/registration#deferred-validation)). @@ -52,7 +52,7 @@ There is no `hardDeleteImmediately` variant — hard delete is deferred-only and **Signature** ```apex -Commitable toHardDelete(SObject record); +Committable toHardDelete(SObject record); ``` **Standard DML** @@ -80,7 +80,7 @@ Hard delete using a record ID directly. **Signature** ```apex -Commitable toHardDelete(Id recordId); +Committable toHardDelete(Id recordId); ``` **Standard DML** @@ -106,8 +106,8 @@ new DML() **Signature** ```apex -Commitable toHardDelete(List records); -Commitable toHardDelete(Iterable recordIds); +Committable toHardDelete(List records); +Committable toHardDelete(Iterable recordIds); ``` **Standard DML** @@ -135,7 +135,7 @@ Hard delete using a collection of record IDs. **Signature** ```apex -Commitable toHardDelete(Iterable recordIds); +Committable toHardDelete(Iterable recordIds); ``` **Standard DML** diff --git a/website/dml/insert.md b/website/dml/insert.md index d47fffa..b57bf42 100644 --- a/website/dml/insert.md +++ b/website/dml/insert.md @@ -13,10 +13,10 @@ Register records for insertion. The actual DML is executed when `commitWork()` i **Signature** ```apex -Commitable toInsert(SObject record); -Commitable toInsert(DML.Record record); -Commitable toInsert(List records); -Commitable toInsert(DML.Records records); +Committable toInsert(SObject record); +Committable toInsert(DML.Record record); +Committable toInsert(List records); +Committable toInsert(DML.Records records); ``` **Example** @@ -40,7 +40,7 @@ new DML() **Signature** ```apex -Commitable toInsert(SObject record); +Committable toInsert(SObject record); ``` **Standard DML** @@ -64,7 +64,7 @@ Handle parent-child relationships automatically. **Signature** ```apex -Commitable toInsert(DML.Record record); +Committable toInsert(DML.Record record); ``` **Standard DML** @@ -100,7 +100,7 @@ Set field values dynamically using `DML.Record`. **Signature** ```apex -Commitable toInsert(DML.Record record); +Committable toInsert(DML.Record record); ``` **Standard DML** @@ -126,8 +126,8 @@ new DML() **Signature** ```apex -Commitable toInsert(List records); -Commitable toInsert(DML.Records records); +Committable toInsert(List records); +Committable toInsert(DML.Records records); ``` **Standard DML** @@ -158,7 +158,7 @@ new DML() **Signature** ```apex -Commitable toInsert(DML.Records records); +Committable toInsert(DML.Records records); ``` **Standard DML** @@ -201,7 +201,7 @@ Set field values dynamically for multiple records using `DML.Records`. **Signature** ```apex -Commitable toInsert(DML.Records records); +Committable toInsert(DML.Records records); ``` **Standard DML** diff --git a/website/dml/merge.md b/website/dml/merge.md index 30fbb3c..55a203e 100644 --- a/website/dml/merge.md +++ b/website/dml/merge.md @@ -27,10 +27,10 @@ Register records for merging. The actual DML is executed when `commitWork()` is **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, SObject duplicatedRecord); -Commitable toMerge(SObject mergeToRecord, List duplicateRecords); -Commitable toMerge(SObject mergeToRecord, Id duplicatedRecordId); -Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); +Committable toMerge(SObject mergeToRecord, SObject duplicatedRecord); +Committable toMerge(SObject mergeToRecord, List duplicateRecords); +Committable toMerge(SObject mergeToRecord, Id duplicatedRecordId); +Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); ``` ### Single Duplicate Record @@ -38,7 +38,7 @@ Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, SObject duplicatedRecord); +Committable toMerge(SObject mergeToRecord, SObject duplicatedRecord); ``` **Standard DML** @@ -68,7 +68,7 @@ Merge using a duplicate record ID directly. **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, Id duplicatedRecordId); +Committable toMerge(SObject mergeToRecord, Id duplicatedRecordId); ``` **Standard DML** @@ -96,8 +96,8 @@ new DML() **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, List duplicateRecords); -Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); +Committable toMerge(SObject mergeToRecord, List duplicateRecords); +Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); ``` **Standard DML** @@ -127,7 +127,7 @@ Merge using a collection of duplicate record IDs. **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); +Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); ``` **Standard DML** diff --git a/website/dml/publish.md b/website/dml/publish.md index e0e4d10..787ce11 100644 --- a/website/dml/publish.md +++ b/website/dml/publish.md @@ -25,8 +25,8 @@ Register platform events for publishing. The actual publish is executed when `co **Signature** ```apex -Commitable toPublish(SObject record); -Commitable toPublish(List records); +Committable toPublish(SObject record); +Committable toPublish(List records); ``` ### Single Event @@ -34,7 +34,7 @@ Commitable toPublish(List records); **Signature** ```apex -Commitable toPublish(SObject record); +Committable toPublish(SObject record); ``` **Standard DML** @@ -59,7 +59,7 @@ new DML() **Signature** ```apex -Commitable toPublish(List records); +Committable toPublish(List records); ``` **Standard DML** diff --git a/website/dml/undelete.md b/website/dml/undelete.md index 1cc840a..d806ffe 100644 --- a/website/dml/undelete.md +++ b/website/dml/undelete.md @@ -29,10 +29,10 @@ Register records for undeletion. The actual DML is executed when `commitWork()` **Signature** ```apex -Commitable toUndelete(Id recordId); -Commitable toUndelete(SObject record); -Commitable toUndelete(Iterable recordIds); -Commitable toUndelete(List records); +Committable toUndelete(Id recordId); +Committable toUndelete(SObject record); +Committable toUndelete(Iterable recordIds); +Committable toUndelete(List records); ``` ### Single Record @@ -40,7 +40,7 @@ Commitable toUndelete(List records); **Signature** ```apex -Commitable toUndelete(SObject record); +Committable toUndelete(SObject record); ``` **Standard DML** @@ -67,7 +67,7 @@ Undelete using a record ID directly. **Signature** ```apex -Commitable toUndelete(Id recordId); +Committable toUndelete(Id recordId); ``` **Standard DML** @@ -92,8 +92,8 @@ new DML() **Signature** ```apex -Commitable toUndelete(List records); -Commitable toUndelete(Iterable recordIds); +Committable toUndelete(List records); +Committable toUndelete(Iterable recordIds); ``` **Standard DML** @@ -120,7 +120,7 @@ Undelete using a collection of record IDs. **Signature** ```apex -Commitable toUndelete(Iterable recordIds); +Committable toUndelete(Iterable recordIds); ``` **Standard DML** diff --git a/website/dml/update.md b/website/dml/update.md index becc03f..b7733ff 100644 --- a/website/dml/update.md +++ b/website/dml/update.md @@ -29,10 +29,10 @@ Register records for update. The actual DML is executed when `commitWork()` is c **Signature** ```apex -Commitable toUpdate(SObject record); -Commitable toUpdate(DML.Record record); -Commitable toUpdate(List records); -Commitable toUpdate(DML.Records records); +Committable toUpdate(SObject record); +Committable toUpdate(DML.Record record); +Committable toUpdate(List records); +Committable toUpdate(DML.Records records); ``` ### Single Record @@ -40,7 +40,7 @@ Commitable toUpdate(DML.Records records); **Signature** ```apex -Commitable toUpdate(SObject record); +Committable toUpdate(SObject record); ``` **Standard DML** @@ -69,7 +69,7 @@ Update parent-child relationships automatically. **Signature** ```apex -Commitable toUpdate(DML.Record record); +Committable toUpdate(DML.Record record); ``` **Standard DML** @@ -102,7 +102,7 @@ Set field values dynamically using `DML.Record`. **Signature** ```apex -Commitable toUpdate(DML.Record record); +Committable toUpdate(DML.Record record); ``` **Standard DML** @@ -128,8 +128,8 @@ new DML() **Signature** ```apex -Commitable toUpdate(List records); -Commitable toUpdate(DML.Records records); +Committable toUpdate(List records); +Committable toUpdate(DML.Records records); ``` **Standard DML** @@ -160,7 +160,7 @@ new DML() **Signature** ```apex -Commitable toUpdate(DML.Records records); +Committable toUpdate(DML.Records records); ``` **Standard DML** @@ -195,7 +195,7 @@ Set field values dynamically for multiple records using `DML.Records`. **Signature** ```apex -Commitable toUpdate(DML.Records records); +Committable toUpdate(DML.Records records); ``` **Standard DML** diff --git a/website/dml/upsert.md b/website/dml/upsert.md index 1a9277a..a9bf41a 100644 --- a/website/dml/upsert.md +++ b/website/dml/upsert.md @@ -29,12 +29,12 @@ Register records for upsert. The actual DML is executed when `commitWork()` is c **Signature** ```apex -Commitable toUpsert(SObject record); -Commitable toUpsert(SObject record, SObjectField externalIdField); -Commitable toUpsert(DML.Record record); -Commitable toUpsert(List records); -Commitable toUpsert(List records, SObjectField externalIdField); -Commitable toUpsert(DML.Records records); +Committable toUpsert(SObject record); +Committable toUpsert(SObject record, SObjectField externalIdField); +Committable toUpsert(DML.Record record); +Committable toUpsert(List records); +Committable toUpsert(List records, SObjectField externalIdField); +Committable toUpsert(DML.Records records); ``` ### Single Record @@ -42,7 +42,7 @@ Commitable toUpsert(DML.Records records); **Signature** ```apex -Commitable toUpsert(SObject record); +Committable toUpsert(SObject record); ``` **Standard DML** @@ -69,7 +69,7 @@ Handle parent-child relationships automatically. **Signature** ```apex -Commitable toUpsert(DML.Record record); +Committable toUpsert(DML.Record record); ``` **Standard DML** @@ -105,7 +105,7 @@ Set field values dynamically using `DML.Record`. **Signature** ```apex -Commitable toUpsert(DML.Record record); +Committable toUpsert(DML.Record record); ``` **Standard DML** @@ -133,7 +133,7 @@ Upsert using a custom external ID field instead of the standard Id field. **Signature** ```apex -Commitable toUpsert(SObject record, SObjectField externalIdField); +Committable toUpsert(SObject record, SObjectField externalIdField); ``` **Standard DML** @@ -164,8 +164,8 @@ new DML() **Signature** ```apex -Commitable toUpsert(List records); -Commitable toUpsert(DML.Records records); +Committable toUpsert(List records); +Committable toUpsert(DML.Records records); ``` **Standard DML** @@ -196,7 +196,7 @@ new DML() **Signature** ```apex -Commitable toUpsert(DML.Records records); +Committable toUpsert(DML.Records records); ``` **Standard DML** @@ -239,7 +239,7 @@ Set field values dynamically for multiple records using `DML.Records`. **Signature** ```apex -Commitable toUpsert(DML.Records records); +Committable toUpsert(DML.Records records); ``` **Standard DML** @@ -276,7 +276,7 @@ Upsert multiple records using a custom external ID field instead of the standard **Signature** ```apex -Commitable toUpsert(List records, SObjectField externalIdField); +Committable toUpsert(List records, SObjectField externalIdField); ``` **Standard DML** diff --git a/website/examples.md b/website/examples.md index 14316f7..ef3db2c 100644 --- a/website/examples.md +++ b/website/examples.md @@ -17,7 +17,7 @@ public with sharing class OrderImportService { Contact newContact = new Contact(LastName = payload.contactLastName, Email = payload.contactEmail); Order newOrder = new Order(EffectiveDate = Date.today(), Status = 'Draft'); - DML.Commitable unitOfWork = new DML() + DML.Committable unitOfWork = new DML() .toInsert(DML.Record(newContact).withRelationship(Contact.AccountId, account)) .toInsert(DML.Record(newOrder).withRelationship(Order.AccountId, account)) .toInsert(account) diff --git a/website/release.md b/website/release.md index c1c3501..138f8da 100644 --- a/website/release.md +++ b/website/release.md @@ -4,7 +4,7 @@ outline: deep # Changelog -## v3.2.0 +## v4.0.0 **New Features** diff --git a/website/versions/3.1.0/architecture/registration.md b/website/versions/3.1.0/architecture/registration.md index f949e4f..bbd9eb6 100644 --- a/website/versions/3.1.0/architecture/registration.md +++ b/website/versions/3.1.0/architecture/registration.md @@ -44,7 +44,7 @@ Use `combineOnDuplicate()` to automatically merge duplicate registrations into a **Signature** ```apex -Commitable combineOnDuplicate(); +Committable combineOnDuplicate(); ``` **Example** diff --git a/website/versions/3.1.0/configuration/dml-options.md b/website/versions/3.1.0/configuration/dml-options.md index a42fb6d..9b95b38 100644 --- a/website/versions/3.1.0/configuration/dml-options.md +++ b/website/versions/3.1.0/configuration/dml-options.md @@ -31,7 +31,7 @@ Allow some records to succeed while others fail, without rolling back the entire **Signature** ```apex -Commitable allowPartialSuccess(); +Committable allowPartialSuccess(); ``` **Standard DML** @@ -106,7 +106,7 @@ Skip duplicate rule evaluation during DML operations. **Signature** ```apex -Commitable skipDuplicateRules(); +Committable skipDuplicateRules(); ``` **Standard DML** @@ -149,7 +149,7 @@ Provide custom `Database.DmlOptions` for fine-grained control over DML behavior. **Signature** ```apex -Commitable options(Database.DmlOptions options); +Committable options(Database.DmlOptions options); ``` **Standard DML** diff --git a/website/versions/3.1.0/configuration/field-level-security.md b/website/versions/3.1.0/configuration/field-level-security.md index 32095c6..bc494e2 100644 --- a/website/versions/3.1.0/configuration/field-level-security.md +++ b/website/versions/3.1.0/configuration/field-level-security.md @@ -24,7 +24,7 @@ Execute DML operations respecting user permissions. This is the **default behavi **Signature** ```apex -Commitable userMode(); +Committable userMode(); ``` **Standard DML** @@ -49,7 +49,7 @@ Execute DML operations bypassing user permissions. Use this when you need to per **Signature** ```apex -Commitable systemMode(); +Committable systemMode(); ``` **Standard DML** diff --git a/website/versions/3.1.0/configuration/sharing-mode.md b/website/versions/3.1.0/configuration/sharing-mode.md index fa582aa..d0337c2 100644 --- a/website/versions/3.1.0/configuration/sharing-mode.md +++ b/website/versions/3.1.0/configuration/sharing-mode.md @@ -49,7 +49,7 @@ Execute DML operations enforcing sharing rules. Records the user doesn't have ac **Signature** ```apex -Commitable withSharing(); +Committable withSharing(); ``` **Standard DML** @@ -81,7 +81,7 @@ To use `.withoutSharing()`, the `.systemMode()` must be enabled. **Signature** ```apex -Commitable withoutSharing(); +Committable withoutSharing(); ``` **Standard DML** diff --git a/website/versions/3.1.0/dml/delete.md b/website/versions/3.1.0/dml/delete.md index 2e01b8d..426d53b 100644 --- a/website/versions/3.1.0/dml/delete.md +++ b/website/versions/3.1.0/dml/delete.md @@ -29,10 +29,10 @@ Register records for deletion. The actual DML is executed when `commitWork()` is **Signature** ```apex -Commitable toDelete(Id recordId); -Commitable toDelete(SObject record); -Commitable toDelete(Iterable recordIds); -Commitable toDelete(List records); +Committable toDelete(Id recordId); +Committable toDelete(SObject record); +Committable toDelete(Iterable recordIds); +Committable toDelete(List records); ``` ### Single Record @@ -40,7 +40,7 @@ Commitable toDelete(List records); **Signature** ```apex -Commitable toDelete(SObject record); +Committable toDelete(SObject record); ``` **Standard DML** @@ -67,7 +67,7 @@ Delete using a record ID directly. **Signature** ```apex -Commitable toDelete(Id recordId); +Committable toDelete(Id recordId); ``` **Standard DML** @@ -92,8 +92,8 @@ new DML() **Signature** ```apex -Commitable toDelete(List records); -Commitable toDelete(Iterable recordIds); +Committable toDelete(List records); +Committable toDelete(Iterable recordIds); ``` **Standard DML** @@ -120,7 +120,7 @@ Delete using a collection of record IDs. **Signature** ```apex -Commitable toDelete(Iterable recordIds); +Committable toDelete(Iterable recordIds); ``` **Standard DML** diff --git a/website/versions/3.1.0/dml/insert.md b/website/versions/3.1.0/dml/insert.md index 6f9a0ea..c989a3d 100644 --- a/website/versions/3.1.0/dml/insert.md +++ b/website/versions/3.1.0/dml/insert.md @@ -13,10 +13,10 @@ Register records for insertion. The actual DML is executed when `commitWork()` i **Signature** ```apex -Commitable toInsert(SObject record); -Commitable toInsert(DML.Record record); -Commitable toInsert(Iterable records); -Commitable toInsert(DML.Records records); +Committable toInsert(SObject record); +Committable toInsert(DML.Record record); +Committable toInsert(Iterable records); +Committable toInsert(DML.Records records); ``` **Example** @@ -40,7 +40,7 @@ new DML() **Signature** ```apex -Commitable toInsert(SObject record); +Committable toInsert(SObject record); ``` **Standard DML** @@ -64,7 +64,7 @@ Handle parent-child relationships automatically. **Signature** ```apex -Commitable toInsert(DML.Record record); +Committable toInsert(DML.Record record); ``` **Standard DML** @@ -100,7 +100,7 @@ Set field values dynamically using `DML.Record`. **Signature** ```apex -Commitable toInsert(DML.Record record); +Committable toInsert(DML.Record record); ``` **Standard DML** @@ -126,8 +126,8 @@ new DML() **Signature** ```apex -Commitable toInsert(Iterable records); -Commitable toInsert(DML.Records records); +Committable toInsert(Iterable records); +Committable toInsert(DML.Records records); ``` **Standard DML** @@ -158,7 +158,7 @@ new DML() **Signature** ```apex -Commitable toInsert(DML.Records records); +Committable toInsert(DML.Records records); ``` **Standard DML** @@ -201,7 +201,7 @@ Set field values dynamically for multiple records using `DML.Records`. **Signature** ```apex -Commitable toInsert(DML.Records records); +Committable toInsert(DML.Records records); ``` **Standard DML** diff --git a/website/versions/3.1.0/dml/merge.md b/website/versions/3.1.0/dml/merge.md index 30fbb3c..55a203e 100644 --- a/website/versions/3.1.0/dml/merge.md +++ b/website/versions/3.1.0/dml/merge.md @@ -27,10 +27,10 @@ Register records for merging. The actual DML is executed when `commitWork()` is **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, SObject duplicatedRecord); -Commitable toMerge(SObject mergeToRecord, List duplicateRecords); -Commitable toMerge(SObject mergeToRecord, Id duplicatedRecordId); -Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); +Committable toMerge(SObject mergeToRecord, SObject duplicatedRecord); +Committable toMerge(SObject mergeToRecord, List duplicateRecords); +Committable toMerge(SObject mergeToRecord, Id duplicatedRecordId); +Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); ``` ### Single Duplicate Record @@ -38,7 +38,7 @@ Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, SObject duplicatedRecord); +Committable toMerge(SObject mergeToRecord, SObject duplicatedRecord); ``` **Standard DML** @@ -68,7 +68,7 @@ Merge using a duplicate record ID directly. **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, Id duplicatedRecordId); +Committable toMerge(SObject mergeToRecord, Id duplicatedRecordId); ``` **Standard DML** @@ -96,8 +96,8 @@ new DML() **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, List duplicateRecords); -Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); +Committable toMerge(SObject mergeToRecord, List duplicateRecords); +Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); ``` **Standard DML** @@ -127,7 +127,7 @@ Merge using a collection of duplicate record IDs. **Signature** ```apex -Commitable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); +Committable toMerge(SObject mergeToRecord, Iterable duplicatedRecordIds); ``` **Standard DML** diff --git a/website/versions/3.1.0/dml/publish.md b/website/versions/3.1.0/dml/publish.md index e0e4d10..787ce11 100644 --- a/website/versions/3.1.0/dml/publish.md +++ b/website/versions/3.1.0/dml/publish.md @@ -25,8 +25,8 @@ Register platform events for publishing. The actual publish is executed when `co **Signature** ```apex -Commitable toPublish(SObject record); -Commitable toPublish(List records); +Committable toPublish(SObject record); +Committable toPublish(List records); ``` ### Single Event @@ -34,7 +34,7 @@ Commitable toPublish(List records); **Signature** ```apex -Commitable toPublish(SObject record); +Committable toPublish(SObject record); ``` **Standard DML** @@ -59,7 +59,7 @@ new DML() **Signature** ```apex -Commitable toPublish(List records); +Committable toPublish(List records); ``` **Standard DML** diff --git a/website/versions/3.1.0/dml/undelete.md b/website/versions/3.1.0/dml/undelete.md index 9d33bc8..3acca39 100644 --- a/website/versions/3.1.0/dml/undelete.md +++ b/website/versions/3.1.0/dml/undelete.md @@ -29,10 +29,10 @@ Register records for undeletion. The actual DML is executed when `commitWork()` **Signature** ```apex -Commitable toUndelete(Id recordId); -Commitable toUndelete(SObject record); -Commitable toUndelete(Iterable recordIds); -Commitable toUndelete(List records); +Committable toUndelete(Id recordId); +Committable toUndelete(SObject record); +Committable toUndelete(Iterable recordIds); +Committable toUndelete(List records); ``` ### Single Record @@ -40,7 +40,7 @@ Commitable toUndelete(List records); **Signature** ```apex -Commitable toUndelete(SObject record); +Committable toUndelete(SObject record); ``` **Standard DML** @@ -67,7 +67,7 @@ Undelete using a record ID directly. **Signature** ```apex -Commitable toUndelete(Id recordId); +Committable toUndelete(Id recordId); ``` **Standard DML** @@ -92,8 +92,8 @@ new DML() **Signature** ```apex -Commitable toUndelete(List records); -Commitable toUndelete(Iterable recordIds); +Committable toUndelete(List records); +Committable toUndelete(Iterable recordIds); ``` **Standard DML** @@ -120,7 +120,7 @@ Undelete using a collection of record IDs. **Signature** ```apex -Commitable toUndelete(Iterable recordIds); +Committable toUndelete(Iterable recordIds); ``` **Standard DML** diff --git a/website/versions/3.1.0/dml/update.md b/website/versions/3.1.0/dml/update.md index 93f97d6..f701877 100644 --- a/website/versions/3.1.0/dml/update.md +++ b/website/versions/3.1.0/dml/update.md @@ -29,10 +29,10 @@ Register records for update. The actual DML is executed when `commitWork()` is c **Signature** ```apex -Commitable toUpdate(SObject record); -Commitable toUpdate(DML.Record record); -Commitable toUpdate(Iterable records); -Commitable toUpdate(DML.Records records); +Committable toUpdate(SObject record); +Committable toUpdate(DML.Record record); +Committable toUpdate(Iterable records); +Committable toUpdate(DML.Records records); ``` ### Single Record @@ -40,7 +40,7 @@ Commitable toUpdate(DML.Records records); **Signature** ```apex -Commitable toUpdate(SObject record); +Committable toUpdate(SObject record); ``` **Standard DML** @@ -69,7 +69,7 @@ Update parent-child relationships automatically. **Signature** ```apex -Commitable toUpdate(DML.Record record); +Committable toUpdate(DML.Record record); ``` **Standard DML** @@ -102,7 +102,7 @@ Set field values dynamically using `DML.Record`. **Signature** ```apex -Commitable toUpdate(DML.Record record); +Committable toUpdate(DML.Record record); ``` **Standard DML** @@ -128,8 +128,8 @@ new DML() **Signature** ```apex -Commitable toUpdate(Iterable records); -Commitable toUpdate(DML.Records records); +Committable toUpdate(Iterable records); +Committable toUpdate(DML.Records records); ``` **Standard DML** @@ -160,7 +160,7 @@ new DML() **Signature** ```apex -Commitable toUpdate(DML.Records records); +Committable toUpdate(DML.Records records); ``` **Standard DML** @@ -195,7 +195,7 @@ Set field values dynamically for multiple records using `DML.Records`. **Signature** ```apex -Commitable toUpdate(DML.Records records); +Committable toUpdate(DML.Records records); ``` **Standard DML** diff --git a/website/versions/3.1.0/dml/upsert.md b/website/versions/3.1.0/dml/upsert.md index 22e9a94..013bc43 100644 --- a/website/versions/3.1.0/dml/upsert.md +++ b/website/versions/3.1.0/dml/upsert.md @@ -29,12 +29,12 @@ Register records for upsert. The actual DML is executed when `commitWork()` is c **Signature** ```apex -Commitable toUpsert(SObject record); -Commitable toUpsert(SObject record, SObjectField externalIdField); -Commitable toUpsert(DML.Record record); -Commitable toUpsert(List records); -Commitable toUpsert(List records, SObjectField externalIdField); -Commitable toUpsert(DML.Records records); +Committable toUpsert(SObject record); +Committable toUpsert(SObject record, SObjectField externalIdField); +Committable toUpsert(DML.Record record); +Committable toUpsert(List records); +Committable toUpsert(List records, SObjectField externalIdField); +Committable toUpsert(DML.Records records); ``` ### Single Record @@ -42,7 +42,7 @@ Commitable toUpsert(DML.Records records); **Signature** ```apex -Commitable toUpsert(SObject record); +Committable toUpsert(SObject record); ``` **Standard DML** @@ -69,7 +69,7 @@ Handle parent-child relationships automatically. **Signature** ```apex -Commitable toUpsert(DML.Record record); +Committable toUpsert(DML.Record record); ``` **Standard DML** @@ -105,7 +105,7 @@ Set field values dynamically using `DML.Record`. **Signature** ```apex -Commitable toUpsert(DML.Record record); +Committable toUpsert(DML.Record record); ``` **Standard DML** @@ -133,7 +133,7 @@ Upsert using a custom external ID field instead of the standard Id field. **Signature** ```apex -Commitable toUpsert(SObject record, SObjectField externalIdField); +Committable toUpsert(SObject record, SObjectField externalIdField); ``` **Standard DML** @@ -164,8 +164,8 @@ new DML() **Signature** ```apex -Commitable toUpsert(Iterable records); -Commitable toUpsert(DML.Records records); +Committable toUpsert(Iterable records); +Committable toUpsert(DML.Records records); ``` **Standard DML** @@ -196,7 +196,7 @@ new DML() **Signature** ```apex -Commitable toUpsert(DML.Records records); +Committable toUpsert(DML.Records records); ``` **Standard DML** @@ -239,7 +239,7 @@ Set field values dynamically for multiple records using `DML.Records`. **Signature** ```apex -Commitable toUpsert(DML.Records records); +Committable toUpsert(DML.Records records); ``` **Standard DML** @@ -276,7 +276,7 @@ Upsert multiple records using a custom external ID field instead of the standard **Signature** ```apex -Commitable toUpsert(List records, SObjectField externalIdField); +Committable toUpsert(List records, SObjectField externalIdField); ``` **Standard DML** From ab1a50eb57787534a257d8843811ecaa1839280c Mon Sep 17 00:00:00 2001 From: Piotr PG Gajek Date: Sat, 26 Sep 2026 00:31:14 +0200 Subject: [PATCH 2/2] Fix spelling --- README.md | 4 ++-- force-app/main/default/classes/DML_Test.cls | 4 ++-- package/main/default/classes/DML_Full_Test.cls | 16 ++++++++-------- todo | 10 +++++----- website/architecture-decisions.md | 4 ++-- website/architecture.md | 14 +++++++------- website/architecture/rollback.md | 16 ++++++++-------- website/dml/undelete.md | 2 +- website/dml/upsert.md | 4 ++-- website/versions/3.1.0/architecture-decisions.md | 4 ++-- website/versions/3.1.0/architecture.md | 16 ++++++++-------- website/versions/3.1.0/architecture/rollback.md | 16 ++++++++-------- website/versions/3.1.0/dml/undelete.md | 2 +- website/versions/3.1.0/dml/upsert.md | 4 ++-- website/versions/3.1.0/installation.md | 2 +- website/versions/3.1.0/result.md | 2 +- 16 files changed, 60 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 59063f5..760123d 100644 --- a/README.md +++ b/README.md @@ -62,5 +62,5 @@ Visit the [documentation](https://dml.beyondthecloud.dev) to view the full docum ## License notes: -- For proper license management each repository should contain LICENSE file similar to this one. -- each original class should contain copyright mark: © Copyright 2026, Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev) +- For proper license management each repository should contain a LICENSE file similar to this one. +- Each original class should contain a copyright mark: © Copyright 2026, Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev) diff --git a/force-app/main/default/classes/DML_Test.cls b/force-app/main/default/classes/DML_Test.cls index 5bdbbb7..2b6d3ca 100644 --- a/force-app/main/default/classes/DML_Test.cls +++ b/force-app/main/default/classes/DML_Test.cls @@ -29,7 +29,7 @@ private class DML_Test { // Verify Assert.areEqual(0, [SELECT COUNT() FROM Account], 'No records should be inserted to the database.'); Assert.areEqual(0, dmlStatementsAfter - dmlStatementsBefore, 'No DML statements should be executed.'); - Assert.areEqual(0, result.inserts().size(), 'Inserted operation result should contain 1 results.'); + Assert.areEqual(0, result.inserts().size(), 'Inserted operation result should contain 0 results.'); Assert.areEqual(0, result.upserts().size(), 'Upserted operation result should contain 0 results.'); Assert.areEqual(0, result.updates().size(), 'Updated operation result should contain 0 results.'); Assert.areEqual(0, result.deletes().size(), 'Deleted operation result should contain 0 results.'); @@ -58,7 +58,7 @@ private class DML_Test { Assert.areEqual(0, result.inserts().size(), 'Inserted operation result should contain 0 results.'); Assert.areEqual(0, result.upserts().size(), 'Upserted operation result should contain 0 results.'); - Assert.areEqual(0, result.updates().size(), 'Updated operation result should contain 0 result.'); + Assert.areEqual(0, result.updates().size(), 'Updated operation result should contain 0 results.'); Assert.areEqual(0, result.deletes().size(), 'Deleted operation result should contain 0 results.'); Assert.areEqual(0, result.undeletes().size(), 'Undeleted operation result should contain 0 results.'); Assert.areEqual(0, result.merges().size(), 'Merged operation result should contain 0 results.'); diff --git a/package/main/default/classes/DML_Full_Test.cls b/package/main/default/classes/DML_Full_Test.cls index ae8d328..c942c57 100644 --- a/package/main/default/classes/DML_Full_Test.cls +++ b/package/main/default/classes/DML_Full_Test.cls @@ -310,7 +310,7 @@ private class DML_Full_Test { // Verify Assert.areEqual(0, [SELECT COUNT() FROM Account], 'No records should be inserted to the database.'); Assert.areEqual(0, dmlStatementsAfter - dmlStatementsBefore, 'No DML statements should be executed.'); - Assert.areEqual(0, result.inserts().size(), 'Inserted operation result should contain 1 results.'); + Assert.areEqual(0, result.inserts().size(), 'Inserted operation result should contain 0 results.'); Assert.areEqual(0, result.upserts().size(), 'Upserted operation result should contain 0 results.'); Assert.areEqual(0, result.updates().size(), 'Updated operation result should contain 0 results.'); Assert.areEqual(0, result.deletes().size(), 'Deleted operation result should contain 0 results.'); @@ -528,7 +528,7 @@ private class DML_Full_Test { Assert.areEqual(0, result.inserts().size(), 'Inserted operation result should contain 0 results.'); Assert.areEqual(0, result.upserts().size(), 'Upserted operation result should contain 0 results.'); - Assert.areEqual(0, result.updates().size(), 'Updated operation result should contain 0 result.'); + Assert.areEqual(0, result.updates().size(), 'Updated operation result should contain 0 results.'); Assert.areEqual(0, result.deletes().size(), 'Deleted operation result should contain 0 results.'); Assert.areEqual(0, result.undeletes().size(), 'Undeleted operation result should contain 0 results.'); Assert.areEqual(0, result.merges().size(), 'Merged operation result should contain 0 results.'); @@ -1532,7 +1532,7 @@ private class DML_Full_Test { Test.stopTest(); // Verify - Assert.areEqual(2, dmlsAfter - dmlsBefore, '2 DML statement should be executed.'); + Assert.areEqual(2, dmlsAfter - dmlsBefore, '2 DML statements should be executed.'); Assert.areEqual(0, [SELECT COUNT() FROM Account], 'Account should be hard deleted.'); // No assertion with ALL ROWS, because there is Salesforce error } @@ -1552,7 +1552,7 @@ private class DML_Full_Test { Test.stopTest(); // Verify - Assert.areEqual(2, dmlsAfter - dmlsBefore, '1 DML statement should be executed.'); + Assert.areEqual(2, dmlsAfter - dmlsBefore, '2 DML statements should be executed.'); Assert.areEqual(0, [SELECT COUNT() FROM Account], 'Account should be hard deleted.'); // No assertion with ALL ROWS, because there is Salesforce error @@ -1590,7 +1590,7 @@ private class DML_Full_Test { Test.stopTest(); // Verify - Assert.areEqual(2, dmlsAfter - dmlsBefore, '1 DML statement should be executed.'); + Assert.areEqual(2, dmlsAfter - dmlsBefore, '2 DML statements should be executed.'); Assert.areEqual(0, [SELECT COUNT() FROM Account], 'Accounts should be hard deleted.'); // No assertion with ALL ROWS, because there is Salesforce error @@ -1625,7 +1625,7 @@ private class DML_Full_Test { Test.stopTest(); // Verify - Assert.areEqual(2, dmlsAfter - dmlsBefore, '1 DML statement should be executed.'); + Assert.areEqual(2, dmlsAfter - dmlsBefore, '2 DML statements should be executed.'); Assert.areEqual(0, [SELECT COUNT() FROM Account], 'Accounts should be hard deleted.'); // No assertion with ALL ROWS, because there is Salesforce error } @@ -1647,7 +1647,7 @@ private class DML_Full_Test { Test.stopTest(); // Verify - Assert.areEqual(2, dmlsAfter - dmlsBefore, '1 DML statement should be executed.'); + Assert.areEqual(2, dmlsAfter - dmlsBefore, '2 DML statements should be executed.'); Assert.areEqual(0, [SELECT COUNT() FROM Account], 'Accounts should be hard deleted.'); // No assertion with ALL ROWS, because there is Salesforce error } @@ -2978,7 +2978,7 @@ private class DML_Full_Test { DML.OperationResult operationResult = result.updatesOf(Account.SObjectType); Assert.areEqual(1, operationResult.records().size(), 'Updated operation result should contain the updated record.'); - Assert.areEqual(0, operationResult.successes().size(), 'Updated operation result should contain 0 success record.'); + Assert.areEqual(0, operationResult.successes().size(), 'Updated operation result should contain 0 success records.'); Assert.areEqual(1, operationResult.failures().size(), 'Updated operation result should contain 1 failure record.'); Assert.areEqual(1, operationResult.recordResults().size(), 'Updated operation result should contain the updated record results.'); diff --git a/todo b/todo index 30a3a0a..7d0eb43 100644 --- a/todo +++ b/todo @@ -4,7 +4,7 @@ - [x] Fluent Bulk records update without the loop e.g. - [x] DML.Records(opportunities).with(Opportunity.Status, 'Closed Won') — loop-free builder that batches field patches, applies FLS (per mode), then registers the op. - [ ] Bulk DMLs — group by SObjectType and operation; execute in chunked batches (default 200) to minimize statements and respect limits. -- [ ] when the same record is added with the same id, avoid duplication, apply for update and upser +- [ ] when the same record is added with the same id, avoid duplication, apply for update and upsert - [ ] Savepoint + rollback — wrap commitWork() in a savepoint; - [x] on error rollback everything; - [ ] clear internal state afterward. @@ -100,7 +100,7 @@ class UowResult { - [x] Clear internal state after commitWork() — prevent re-commit of same operations. - [ ] Query operations — query(), countQuery(), getQueryLocator(), getCursor() with same access/sharing mode. - [ ] Connector to SOQL Lib — inject selectors for reads; honor chosen sharing mode. -- [x] Dedupling registration — when records with the same Id are registered and modify the same field: policy LAST_WINS | THROW; track warnings when deduping occurs. +- [x] Deduping registration — when records with the same Id are registered and modify the same field: policy LAST_WINS | THROW; track warnings when deduping occurs. - [ ] Observability hooks — uow.withLogger(ILogger) to emit timings, limits, retries, per-op summaries; keep lightweight to avoid CPU spikes. - [ ] DML optimization - [ ] Minimize DML statements — batch same-type operations. @@ -130,7 +130,7 @@ DML.Committable db = new DML(); ``` -- [ ] flat intefrace +- [ ] flat interface ``` public interface Result { List all(); @@ -179,7 +179,7 @@ public interface Mockable { Mockable allUndeleteFor(SObjectType objectType); Mockable allPublishesFor(SObjectType objectType); // - then(CustomMocabke) + then(CustomMockable) // Per Operation // MockableOperation onInsert(); // MockableOperation onUpdate(); @@ -262,7 +262,7 @@ Status | Priority | Feature | Effort | Impact | | [ ] | 🟡 Important | Per-Operation Overrides | High | High | | [ ] | 🟡 Important | Email Integration | Medium | Medium | | [ ] | 🟡 Important | Custom Work (IDoWork) | Low | Medium | -| [x] | 🟢 Nice | Dedupling registration | Medium | Medium | +| [x] | 🟢 Nice | Deduping registration | Medium | Medium | | [ ] | 🟢 Nice | Better Mock API with Errors | Medium | Medium | | [ ] | 🟢 Nice | Add operation hashCode to OperationResult | Medium | Medium | | [ ] | 🟢 Nice | Retry Strategy | High | Medium | diff --git a/website/architecture-decisions.md b/website/architecture-decisions.md index 3288817..d73250b 100644 --- a/website/architecture-decisions.md +++ b/website/architecture-decisions.md @@ -1,4 +1,4 @@ -# SavePoint +# Savepoint Statements like: @@ -8,4 +8,4 @@ Statements like: issue DMLs. -Due to that behavior Savepoint has to be explicitly invoke. Default Lib behavior shouldn't create savepoints. \ No newline at end of file +Due to that behavior Savepoint has to be explicitly invoked. Default Lib behavior shouldn't create savepoints. \ No newline at end of file diff --git a/website/architecture.md b/website/architecture.md index a142acd..bf78821 100644 --- a/website/architecture.md +++ b/website/architecture.md @@ -2,7 +2,7 @@ ## DML Transaction Control -When rollback is happening? +When is rollback happening? try-catch | savepoint | allOrNone | rollback | rethrow exception | Is rollback happening? --------- | --------- | --------- | -------- | ----------------- | ----------------------- @@ -19,12 +19,12 @@ try-catch | savepoint | allOrNone | rollback | rethrow exception | Is rollback - `allOrNone=false` will never throw DmlException, and because of it partial commit will be made. - `Savepoint` makes sense only when `allOrNone=true`, so DmlException is thrown and rollback can be called. -- **Unhandled exceptions roll back the entire transaction.** If a DmlException (or any unhandled exception) escapes your code path, Salesforce undoes all DML from that transaction.  -- **allOrNone=true is atomic per call. Any row error makes the single Database.** call fail as a unit and throws (same behavior as DML keywords). Earlier successful calls aren’t automatically undone unless the exception remains unhandled.  -- **allOrNone=false returns SaveResult[] (no row-error exception)**. Successful rows commit; failed rows don’t. You must check results yourself. Other exceptions (e.g., limit/mixed DML) can still occur and roll back the transaction if unhandled.  -- **Catching without rethrowing does not roll back prior successes**. With allOrNone=true, the failing call reverts itself, but earlier successful DML remains unless you escalate (rethrow) or manually roll back.  -- **Savepoints give cross-call atomicity (your whole UoW)**: wrap many DML calls in Database.setSavepoint() and call Database.rollback(sp) on any failure to undo everything since the savepoint. Works with either allOrNone mode.  -- **Savepoint mechanics & limits**: each setSavepoint()/rollback() consumes DML resources; rollback returns to the last savepoint only. Plan chunking and logging accordingly.  +- **Unhandled exceptions roll back the entire transaction.** If a DmlException (or any unhandled exception) escapes your code path, Salesforce undoes all DML from that transaction. +- **allOrNone=true is atomic per call. Any row error makes the single Database.** call fail as a unit and throws (same behavior as DML keywords). Earlier successful calls aren’t automatically undone unless the exception remains unhandled. +- **allOrNone=false returns SaveResult[] (no row-error exception)**. Successful rows commit; failed rows don’t. You must check results yourself. Other exceptions (e.g., limit/mixed DML) can still occur and roll back the transaction if unhandled. +- **Catching without rethrowing does not roll back prior successes**. With allOrNone=true, the failing call reverts itself, but earlier successful DML remains unless you escalate (rethrow) or manually roll back. +- **Savepoints give cross-call atomicity (your whole UoW)**: wrap many DML calls in Database.setSavepoint() and call Database.rollback(sp) on any failure to undo everything since the savepoint. Works with either allOrNone mode. +- **Savepoint mechanics & limits**: each setSavepoint()/rollback() consumes DML resources; rollback returns to the last savepoint only. Plan chunking and logging accordingly. A) allOrNone=true diff --git a/website/architecture/rollback.md b/website/architecture/rollback.md index 416d64f..187ce74 100644 --- a/website/architecture/rollback.md +++ b/website/architecture/rollback.md @@ -1,6 +1,6 @@ # Transaction Rollback -## When rollback is happening? +## When is rollback happening? try-catch | savepoint | allOrNone | rollback | rethrow exception | Is rollback happening? --------- | --------- | --------- | -------- | ----------------- | ----------------------- @@ -18,7 +18,7 @@ try-catch | savepoint | allOrNone | rollback | rethrow exception | Is rollback - Unhandled exceptions roll back the entire transaction. - Caught (not rethrown) exceptions do not roll back earlier successes. - Savepoints give cross-call atomicity: set a savepoint and roll back to it on failure. Works with `allOrNone=true` (with `allOrNone=false`, detect failures and trigger rollback yourself). -- Limits: up to 5 savepoints per transaction; rollback returns to the most recent savepoint. Each `setSavepoint()`/`rollback()`/`releaseSavepoint()` consumes DML resources; +- Limits: up to 5 savepoints per transaction; rollback returns to the most recent savepoint. Each `setSavepoint()`/`rollback()`/`releaseSavepoint()` consumes DML resources. ## What is standard? @@ -27,7 +27,7 @@ public class MyService { public static void makeDmls() { List accounts = ...; List contacts = ...; - List opportunities = ...; + List opportunities = ...; // code here @@ -39,13 +39,13 @@ public class MyService { ``` With no `try–catch`, any unhandled exception rolls back the entire transaction. No records are created, updated, or deleted. -  + ```apex public class MyService { public static void makeDmls() { List accounts = ...; List contacts = ...; - List opportunities = ...; + List opportunities = ...; // code here try { @@ -71,10 +71,10 @@ With a `try–catch` (and no rethrow), the transaction does not auto-rollback. T DML Lib provides two commit styles: - `commitWork()` - does not set a savepoint and does not rethrow to force rollback. Behavior is closest to the usual “plain DML in a method” pattern. -- `commitTransaction()` - sets a savepoint and, if an error occurs, rolls back to that savepoint (all changes since the savepoint are undone). Savepoints/rollbacks count against the DML statement governor limit.  +- `commitTransaction()` - sets a savepoint and, if an error occurs, rolls back to that savepoint (all changes since the savepoint are undone). Savepoints/rollbacks count against the DML statement governor limit. - `commitWork()` + `allowPartialSuccess()` - no exception is thrown for row-level errors; no automatic rollback occurs. Inspect `DML.Result` to handle failures. - `commitTransaction()` + `allowPartialSuccess()` - not supported (by design). If you suppress exceptions, the savepoint won’t be rolled back; therefore this combo is disallowed to avoid misleading behavior. Notes: -- Savepoints/rollbacks: `Database.setSavepoint()` and `Database.rollback(sp)` count toward the DML statement limit (they do not count toward the DML row limit). Use sparingly.  -- If you need cross-call atomicity, use a savepoint and roll back on failure (`commitTransaction()`) ; otherwise, only unhandled exceptions roll back the entire transaction. \ No newline at end of file +- Savepoints/rollbacks: `Database.setSavepoint()` and `Database.rollback(sp)` count toward the DML statement limit (they do not count toward the DML row limit). Use sparingly. +- If you need cross-call atomicity, use a savepoint and roll back on failure (`commitTransaction()`); otherwise, only unhandled exceptions roll back the entire transaction. \ No newline at end of file diff --git a/website/dml/undelete.md b/website/dml/undelete.md index d806ffe..747dc37 100644 --- a/website/dml/undelete.md +++ b/website/dml/undelete.md @@ -4,7 +4,7 @@ outline: deep # Undelete -Restore deleted records from the recycle bin. +Restore deleted records from the Recycle Bin. **Example** diff --git a/website/dml/upsert.md b/website/dml/upsert.md index a9bf41a..68da1cb 100644 --- a/website/dml/upsert.md +++ b/website/dml/upsert.md @@ -126,7 +126,7 @@ new DML() .commitWork(); ``` -#### With External Id Field +#### With External ID Field Upsert using a custom external ID field instead of the standard Id field. @@ -269,7 +269,7 @@ new DML() .commitWork(); ``` -#### With External Id Field +#### With External ID Field Upsert multiple records using a custom external ID field instead of the standard Id field. diff --git a/website/versions/3.1.0/architecture-decisions.md b/website/versions/3.1.0/architecture-decisions.md index f02e447..d73250b 100644 --- a/website/versions/3.1.0/architecture-decisions.md +++ b/website/versions/3.1.0/architecture-decisions.md @@ -1,4 +1,4 @@ -# SavePoint +# Savepoint Statements like: @@ -8,4 +8,4 @@ Statements like: issue DMLs. -Due to that behavior Savepoint has to be explicitly invoke. Default Lib behavior shoudn't create savepoints. \ No newline at end of file +Due to that behavior Savepoint has to be explicitly invoked. Default Lib behavior shouldn't create savepoints. \ No newline at end of file diff --git a/website/versions/3.1.0/architecture.md b/website/versions/3.1.0/architecture.md index 2bdef35..bf78821 100644 --- a/website/versions/3.1.0/architecture.md +++ b/website/versions/3.1.0/architecture.md @@ -2,7 +2,7 @@ ## DML Transaction Control -When rollback is happening? +When is rollback happening? try-catch | savepoint | allOrNone | rollback | rethrow exception | Is rollback happening? --------- | --------- | --------- | -------- | ----------------- | ----------------------- @@ -16,15 +16,15 @@ try-catch | savepoint | allOrNone | rollback | rethrow exception | Is rollback ## Conclusions -- `allOrNone=false` will never throw DmlException, and bacause of it partial commit will be made. +- `allOrNone=false` will never throw DmlException, and because of it partial commit will be made. - `Savepoint` makes sense only when `allOrNone=true`, so DmlException is thrown and rollback can be called. -- **Unhandled exceptions roll back the entire transaction.** If a DmlException (or any unhandled exception) escapes your code path, Salesforce undoes all DML from that transaction.  -- **allOrNone=true is atomic per call. Any row error makes the single Database.** call fail as a unit and throws (same behavior as DML keywords). Earlier successful calls aren’t automatically undone unless the exception remains unhandled.  -- **allOrNone=false returns SaveResult[] (no row-error exception)**. Successful rows commit; failed rows don’t. You must check results yourself. Other exceptions (e.g., limit/mixed DML) can still occur and roll back the transaction if unhandled.  -- **Catching without rethrowing does not roll back prior successes**. With allOrNone=true, the failing call reverts itself, but earlier successful DML remains unless you escalate (rethrow) or manually roll back.  -- **Savepoints give cross-call atomicity (your whole UoW)**: wrap many DML calls in Database.setSavepoint() and call Database.rollback(sp) on any failure to undo everything since the savepoint. Works with either allOrNone mode.  -- **Savepoint mechanics & limits**: each setSavepoint()/rollback() consumes DML resources; rollback returns to the last savepoint only. Plan chunking and logging accordingly.  +- **Unhandled exceptions roll back the entire transaction.** If a DmlException (or any unhandled exception) escapes your code path, Salesforce undoes all DML from that transaction. +- **allOrNone=true is atomic per call. Any row error makes the single Database.** call fail as a unit and throws (same behavior as DML keywords). Earlier successful calls aren’t automatically undone unless the exception remains unhandled. +- **allOrNone=false returns SaveResult[] (no row-error exception)**. Successful rows commit; failed rows don’t. You must check results yourself. Other exceptions (e.g., limit/mixed DML) can still occur and roll back the transaction if unhandled. +- **Catching without rethrowing does not roll back prior successes**. With allOrNone=true, the failing call reverts itself, but earlier successful DML remains unless you escalate (rethrow) or manually roll back. +- **Savepoints give cross-call atomicity (your whole UoW)**: wrap many DML calls in Database.setSavepoint() and call Database.rollback(sp) on any failure to undo everything since the savepoint. Works with either allOrNone mode. +- **Savepoint mechanics & limits**: each setSavepoint()/rollback() consumes DML resources; rollback returns to the last savepoint only. Plan chunking and logging accordingly. A) allOrNone=true diff --git a/website/versions/3.1.0/architecture/rollback.md b/website/versions/3.1.0/architecture/rollback.md index 416d64f..187ce74 100644 --- a/website/versions/3.1.0/architecture/rollback.md +++ b/website/versions/3.1.0/architecture/rollback.md @@ -1,6 +1,6 @@ # Transaction Rollback -## When rollback is happening? +## When is rollback happening? try-catch | savepoint | allOrNone | rollback | rethrow exception | Is rollback happening? --------- | --------- | --------- | -------- | ----------------- | ----------------------- @@ -18,7 +18,7 @@ try-catch | savepoint | allOrNone | rollback | rethrow exception | Is rollback - Unhandled exceptions roll back the entire transaction. - Caught (not rethrown) exceptions do not roll back earlier successes. - Savepoints give cross-call atomicity: set a savepoint and roll back to it on failure. Works with `allOrNone=true` (with `allOrNone=false`, detect failures and trigger rollback yourself). -- Limits: up to 5 savepoints per transaction; rollback returns to the most recent savepoint. Each `setSavepoint()`/`rollback()`/`releaseSavepoint()` consumes DML resources; +- Limits: up to 5 savepoints per transaction; rollback returns to the most recent savepoint. Each `setSavepoint()`/`rollback()`/`releaseSavepoint()` consumes DML resources. ## What is standard? @@ -27,7 +27,7 @@ public class MyService { public static void makeDmls() { List accounts = ...; List contacts = ...; - List opportunities = ...; + List opportunities = ...; // code here @@ -39,13 +39,13 @@ public class MyService { ``` With no `try–catch`, any unhandled exception rolls back the entire transaction. No records are created, updated, or deleted. -  + ```apex public class MyService { public static void makeDmls() { List accounts = ...; List contacts = ...; - List opportunities = ...; + List opportunities = ...; // code here try { @@ -71,10 +71,10 @@ With a `try–catch` (and no rethrow), the transaction does not auto-rollback. T DML Lib provides two commit styles: - `commitWork()` - does not set a savepoint and does not rethrow to force rollback. Behavior is closest to the usual “plain DML in a method” pattern. -- `commitTransaction()` - sets a savepoint and, if an error occurs, rolls back to that savepoint (all changes since the savepoint are undone). Savepoints/rollbacks count against the DML statement governor limit.  +- `commitTransaction()` - sets a savepoint and, if an error occurs, rolls back to that savepoint (all changes since the savepoint are undone). Savepoints/rollbacks count against the DML statement governor limit. - `commitWork()` + `allowPartialSuccess()` - no exception is thrown for row-level errors; no automatic rollback occurs. Inspect `DML.Result` to handle failures. - `commitTransaction()` + `allowPartialSuccess()` - not supported (by design). If you suppress exceptions, the savepoint won’t be rolled back; therefore this combo is disallowed to avoid misleading behavior. Notes: -- Savepoints/rollbacks: `Database.setSavepoint()` and `Database.rollback(sp)` count toward the DML statement limit (they do not count toward the DML row limit). Use sparingly.  -- If you need cross-call atomicity, use a savepoint and roll back on failure (`commitTransaction()`) ; otherwise, only unhandled exceptions roll back the entire transaction. \ No newline at end of file +- Savepoints/rollbacks: `Database.setSavepoint()` and `Database.rollback(sp)` count toward the DML statement limit (they do not count toward the DML row limit). Use sparingly. +- If you need cross-call atomicity, use a savepoint and roll back on failure (`commitTransaction()`); otherwise, only unhandled exceptions roll back the entire transaction. \ No newline at end of file diff --git a/website/versions/3.1.0/dml/undelete.md b/website/versions/3.1.0/dml/undelete.md index 3acca39..c3b6f93 100644 --- a/website/versions/3.1.0/dml/undelete.md +++ b/website/versions/3.1.0/dml/undelete.md @@ -4,7 +4,7 @@ outline: deep # Undelete -Restore deleted records from the recycle bin. +Restore deleted records from the Recycle Bin. **Example** diff --git a/website/versions/3.1.0/dml/upsert.md b/website/versions/3.1.0/dml/upsert.md index 013bc43..84af1dd 100644 --- a/website/versions/3.1.0/dml/upsert.md +++ b/website/versions/3.1.0/dml/upsert.md @@ -126,7 +126,7 @@ new DML() .commitWork(); ``` -#### With External Id Field +#### With External ID Field Upsert using a custom external ID field instead of the standard Id field. @@ -269,7 +269,7 @@ new DML() .commitWork(); ``` -#### With External Id Field +#### With External ID Field Upsert multiple records using a custom external ID field instead of the standard Id field. diff --git a/website/versions/3.1.0/installation.md b/website/versions/3.1.0/installation.md index bdf2d6f..2ff9171 100644 --- a/website/versions/3.1.0/installation.md +++ b/website/versions/3.1.0/installation.md @@ -8,7 +8,7 @@ sf package version promote --package "DML Lib@3.1.0-1" --target-dev-hub beyondthecloud-prod --> -Install the SOQL Lib unlocked package with `btcdev` namespace to your Salesforce environment: +Install the DML Lib unlocked package with `btcdev` namespace to your Salesforce environment: `/packaging/installPackage.apexp?p0=04tP60000036moDIAQ` diff --git a/website/versions/3.1.0/result.md b/website/versions/3.1.0/result.md index 8d8a7c5..b6d081f 100644 --- a/website/versions/3.1.0/result.md +++ b/website/versions/3.1.0/result.md @@ -11,7 +11,7 @@ The DML library provides comprehensive result handling through the [`Result`](#r When you call `commitWork()`, `commitTransaction()` or `dryRun()`, a `Result` object is returned containing detailed information about each DML operation performed. ::: info -`Result` is returned only when **no errors occur** or `allowPartialSuccess()` is enabled. Otherwise, a `DmlException` will be thrown, which mimcs standard DML behaviour. +`Result` is returned only when **no errors occur** or `allowPartialSuccess()` is enabled. Otherwise, a `DmlException` will be thrown, which mimics standard DML behavior. ::: ```apex