@Test public void testBulkUpgradeObjectGroups_bulkUpdate() throws Exception { String dataSetFile = "DataMigrationR6/15ObjectGroupDataSet/R6ObjectGroupDataSet.json"; importObjectGroupDataSetFile(dataSetFile); repository.bulkUpgradeObjectGroups(Arrays.asList("1", "6")); ObjectGroup og6_updated = (ObjectGroup) MetadataCollections.OBJECTGROUP.getCollection().find(eq(ObjectGroup.ID, "6")).first(); ObjectGroup og4_not_updated = (ObjectGroup) MetadataCollections.OBJECTGROUP.getCollection().find(eq(ObjectGroup.ID, "4")).first(); assertThat(og6_updated.get(ObjectGroup.GRAPH_LAST_PERSISTED_DATE)).isNotNull(); assertThat(og4_not_updated.get(ObjectGroup.GRAPH_LAST_PERSISTED_DATE)).isNull(); }
public void bulkUpgradeObjectGroups(List<String> objectGroupIds) { String graphLastPersistedDate = LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()); MetadataCollections.OBJECTGROUP.getCollection().updateMany( in(ObjectGroup.ID, objectGroupIds), Updates.set(ObjectGroup.GRAPH_LAST_PERSISTED_DATE, graphLastPersistedDate) ); }
DataMigrationRepository { public void bulkUpgradeObjectGroups(List<String> objectGroupIds) { String graphLastPersistedDate = LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()); MetadataCollections.OBJECTGROUP.getCollection().updateMany( in(ObjectGroup.ID, objectGroupIds), Updates.set(ObjectGroup.GRAPH_LAST_PERSISTED_DATE, graphLastPersistedDate) ); } }
DataMigrationRepository { public void bulkUpgradeObjectGroups(List<String> objectGroupIds) { String graphLastPersistedDate = LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()); MetadataCollections.OBJECTGROUP.getCollection().updateMany( in(ObjectGroup.ID, objectGroupIds), Updates.set(ObjectGroup.GRAPH_LAST_PERSISTED_DATE, graphLastPersistedDate) ); } DataMigrationRepository(); @VisibleForTesting  DataMigrationRepository(int bulkSize); }
DataMigrationRepository { public void bulkUpgradeObjectGroups(List<String> objectGroupIds) { String graphLastPersistedDate = LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()); MetadataCollections.OBJECTGROUP.getCollection().updateMany( in(ObjectGroup.ID, objectGroupIds), Updates.set(ObjectGroup.GRAPH_LAST_PERSISTED_DATE, graphLastPersistedDate) ); } DataMigrationRepository(); @VisibleForTesting  DataMigrationRepository(int bulkSize); CloseableIterator<List<Unit>> selectUnitBulkInTopDownHierarchyLevel(); Map<String, Unit> getUnitGraphByIds(Collection<String> unitIds); void bulkReplaceUnits(List<Unit> updatedUnits); CloseableIterator<List<String>> selectObjectGroupBulk(); void bulkUpgradeObjectGroups(List<String> objectGroupIds); }
DataMigrationRepository { public void bulkUpgradeObjectGroups(List<String> objectGroupIds) { String graphLastPersistedDate = LocalDateUtil.getFormattedDateForMongo(LocalDateUtil.now()); MetadataCollections.OBJECTGROUP.getCollection().updateMany( in(ObjectGroup.ID, objectGroupIds), Updates.set(ObjectGroup.GRAPH_LAST_PERSISTED_DATE, graphLastPersistedDate) ); } DataMigrationRepository(); @VisibleForTesting  DataMigrationRepository(int bulkSize); CloseableIterator<List<Unit>> selectUnitBulkInTopDownHierarchyLevel(); Map<String, Unit> getUnitGraphByIds(Collection<String> unitIds); void bulkReplaceUnits(List<Unit> updatedUnits); CloseableIterator<List<String>> selectObjectGroupBulk(); void bulkUpgradeObjectGroups(List<String> objectGroupIds);  }