mirror of
https://github.com/google/nomulus
synced 2026-10-01 04:05:49 +00:00
Differentiate between inserts and updates in flows (#2846)
Updates (AKA merges) run an extra SELECT statement to figure out if the resource exists so that it can merge the entity into the existing object in Hibernate's schema. When we're inserting new rows (such as new poll messages or resource creates), we know that we don't need to do that merge. Doing this should save us some SELECT statements (this has borne out to be the truth in alpha)
This commit is contained in:
+3
-2
@@ -40,8 +40,9 @@ public class TestDomainCreateFlowCustomLogic extends DomainCreateFlowCustomLogic
|
||||
.setMsg("Custom logic was triggered")
|
||||
.build();
|
||||
return EntityChanges.newBuilder()
|
||||
.setSaves(parameters.entityChanges().getSaves())
|
||||
.addSave(extraPollMessage)
|
||||
.setInserts(parameters.entityChanges().getInserts())
|
||||
.addInsert(extraPollMessage)
|
||||
.setUpdates(parameters.entityChanges().getUpdates())
|
||||
.setDeletes(parameters.entityChanges().getDeletes())
|
||||
.build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user