-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add overloaded method for register dirty with relationships #400
base: master
Are you sure you want to change the base?
Add overloaded method for register dirty with relationships #400
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @daveespo and @wimvelzeboer)
sfdx-source/apex-common/main/classes/fflib_SObjectUnitOfWork.cls, line 291 at r1 (raw file):
* @param relatedToParentRecord A SObject instance of the parent record (should also be registered as new separately) **/ public void registerNew(List<SObject> records, Schema.SObjectField relatedToParentField, SObject relatedToParentRecord)
@wimvelzeboer - the implementation of the new 'overloaded' versions of registerNew and registerDirty are not DRY -- there is too much code duplicated between the legacy versions of those methods and the new ones you are proposing here. Can you delegate from the single record versions to the new bulk version?
Routes other registerNew methods to the bulkified method overload.
Yes, I see your point @daveespo. I now routed all the registerNew method overloads to the single bulk method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @daveespo and @wimvelzeboer)
sfdx-source/apex-common/main/classes/fflib_SObjectUnitOfWork.cls, line 291 at r1 (raw file):
Previously, daveespo (David Esposito) wrote…
@wimvelzeboer - the implementation of the new 'overloaded' versions of registerNew and registerDirty are not DRY -- there is too much code duplicated between the legacy versions of those methods and the new ones you are proposing here. Can you delegate from the single record versions to the new bulk version?
@wimvelzeboer I see that you routed the legacy registerNew methods into the new bulkified one. But you didn't address the registerDirty duplicated code -- can you do the same treatment to those methods?
Also, while you probably didn't create any reductions in code coverage with this change, you don't have any tests to exercise an invocation of the bulkified method (passing in more than on SObject instance) so please add those
@daveespo I now added bulk by default, and increased the unit-test coverage with bulk test methods. I also added protected method, which avoid duplicated checks. For example. in the registerDirty method with relationships it previously check for non-event and supported SObjectTypes in registerDirty and then again in registerRelationship. |
Add bulk by default to registerNew & registerDirty Increased unit-test coverage with using bulk Use Custom Labels for exception messages
4f5773a
to
43be47f
Compare
With this change we can link multiple records to the same parent record.
This change is