@SuppressWarnings("unchecked") @Test void testPersistMetaNoneDataUpsert() { Repository<Entity> repository0 = mock(Repository.class); when(dataService.getRepository(entityType0.getId())).thenReturn(repository0); Repository<Entity> repository1 = mock(Repository.class); when(dataService.getRepository(entityType1.getId())).thenReturn(repository1); PersistResult persistResult = dataPersisterImpl.persist(dataProvider, MetadataMode.NONE, DataMode.UPSERT); assertEquals(create(of(entityType0.getId(), 2L, entityType1.getId(), 3L)), persistResult); InOrder inOrder = inOrder(metaDataService, repository0, repository1); inOrder.verify(repository1).upsertBatch(anyList()); inOrder.verify(repository0).upsertBatch(anyList()); verifyNoMoreInteractions(metaDataService, repository0, repository1); }
@Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; }
DataPersisterImpl implements DataPersister { @Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; } }
DataPersisterImpl implements DataPersister { @Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; } DataPersisterImpl(
      MetaDataService metaDataService,
      DataService dataService,
      EntityTypeDependencyResolver entityTypeDependencyResolver); }
DataPersisterImpl implements DataPersister { @Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; } DataPersisterImpl(
      MetaDataService metaDataService,
      DataService dataService,
      EntityTypeDependencyResolver entityTypeDependencyResolver); @Transactional @Override PersistResult persist(
      DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode); }
DataPersisterImpl implements DataPersister { @Transactional @Override public PersistResult persist( DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode) { List<EntityType> sortedEntityTypes = getTopologicalSortedEntityTypes(dataProvider.getEntityTypes()); preProcessEntityTypes(sortedEntityTypes, metadataMode); PersistResult persistResult = persistFirstPass(dataProvider, metadataMode, dataMode, sortedEntityTypes); persistSecondPass(dataProvider, sortedEntityTypes, metadataMode); return persistResult; } DataPersisterImpl(
      MetaDataService metaDataService,
      DataService dataService,
      EntityTypeDependencyResolver entityTypeDependencyResolver); @Transactional @Override PersistResult persist(
      DataProvider dataProvider, MetadataMode metadataMode, DataMode dataMode);  }