@SuppressWarnings("unchecked") @Test void testPersistMetaNoneDataAddAbstractEntityType() { when(entityType0.getLabel()).thenReturn("Entity type #0"); when(entityType0.isAbstract()).thenReturn(true); Exception exception = assertThrows( MolgenisDataException.class, () -> dataPersisterImpl.persist(dataProvider, MetadataMode.NONE, DataMode.ADD)); assertThat(exception.getMessage()) .containsPattern( "Abstract entity type 'Entity type #0' with id 'entityTypeId0' cannot contain entities"); }
@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);  }