Skip to content
Snippets Groups Projects
Commit d099c249 authored by Felix Reichenbach's avatar Felix Reichenbach
Browse files

OZG-7515 refactor M014_AddItemNameBescheidToPatchAttachedItemCommand

parent 99414d55
No related branches found
No related tags found
1 merge request!11Ozg 7515 migrate patch item command
...@@ -61,9 +61,7 @@ public class M014_AddItemNameBescheidToPatchAttachedItemCommand { // NOSONAR ...@@ -61,9 +61,7 @@ public class M014_AddItemNameBescheidToPatchAttachedItemCommand { // NOSONAR
} }
void updateDocuments(MongoOperations mongoOperations, List<String> parentIds) { void updateDocuments(MongoOperations mongoOperations, List<String> parentIds) {
var query = buildQuery(parentIds); mongoOperations.updateMulti(buildQuery(parentIds), buildAddBescheidItemNameUpdate(), COMMAND_COLLECTION_NAME);
var update = new Update().set(ITEM_NAME_FILED, BESCHEID_ITEM_NAME);
mongoOperations.updateMulti(query, update, COMMAND_COLLECTION_NAME);
} }
Query buildQuery(List<String> parentIds) { Query buildQuery(List<String> parentIds) {
...@@ -73,6 +71,10 @@ public class M014_AddItemNameBescheidToPatchAttachedItemCommand { // NOSONAR ...@@ -73,6 +71,10 @@ public class M014_AddItemNameBescheidToPatchAttachedItemCommand { // NOSONAR
Criteria.where(ITEM_NAME_FILED).exists(false))); Criteria.where(ITEM_NAME_FILED).exists(false)));
} }
private Update buildAddBescheidItemNameUpdate() {
return new Update().set(ITEM_NAME_FILED, BESCHEID_ITEM_NAME);
}
@RollbackExecution @RollbackExecution
public void rollback() { public void rollback() {
// kein rollback implementiert // kein rollback implementiert
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment