Skip to content

Commit 4f5773a

Browse files
committed
Change methods into using bulk
Add bulk by default to registerNew & registerDirty Increased unit-test coverage with using bulk Use Custom Labels for exception messages
1 parent f7aa2bb commit 4f5773a

File tree

4 files changed

+374
-129
lines changed

4 files changed

+374
-129
lines changed

sfdx-source/apex-common/main/classes/fflib_ISObjectUnitOfWork.cls

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ public interface fflib_ISObjectUnitOfWork
5050
* @param relatedToParentRecord A SObject instance of the parent record (should also be registered as new separately)
5151
**/
5252
void registerNew(SObject record, Schema.SObjectField relatedToParentField, SObject relatedToParentRecord);
53+
/**
54+
* Register newly created records to be inserted when commitWork is called,
55+
* it also provides a reference to the single parent record instance (should also be registered as new separately)
56+
*
57+
* @param records newly created records of the same SObjectType to be inserted during commitWork
58+
* @param relatedToParentField A SObjectField reference to the child field that associates the child record with its parent
59+
* @param relatedToParentRecord A SObject instance of the parent record (should also be registered as new separately)
60+
**/
61+
void registerNew(List<SObject> records, Schema.SObjectField relatedToParentField, SObject relatedToParentRecord);
5362
/**
5463
* Register a relationship between two records that have yet to be inserted to the database. This information will be
5564
* used during the commitWork phase to make the references only when related records have been inserted to the database.
@@ -59,6 +68,15 @@ public interface fflib_ISObjectUnitOfWork
5968
* @param relatedTo A SObject instance (yet to be committed to the database)
6069
*/
6170
void registerRelationship(SObject record, Schema.SObjectField relatedToField, SObject relatedTo);
71+
/**
72+
* Register a relationship between two records that have yet to be inserted to the database. This information will be
73+
* used during the commitWork phase to make the references only when related records have been inserted to the database.
74+
*
75+
* @param records Existing or newly created records
76+
* @param relatedToField A SObjectField reference to the field that relates the given records to the relatedTo record
77+
* @param relatedTo A SObject instance (yet to be committed to the database)
78+
*/
79+
void registerRelationship(List<SObject> records, Schema.SObjectField relatedToField, SObject relatedTo);
6280
/**
6381
* Registers a relationship between a record and a Messaging.Email where the record has yet to be inserted
6482
* to the database. This information will be

0 commit comments

Comments
 (0)